Skip to content
EASYJEV

HTTP と curl

任意の言語から POST /v1/systemone を直接呼び出す:curl、Python requests、Node fetch、Go のサンプルと、正確な JSON リクエスト/レスポンス構造。

エンドポイント

各判定は https://api.easyjev.online/v1/systemone への 1 回の POST で、Bearer sk- キーを伴います。認証ヘッダー:Authorization: Bearer sk-...。JSON 本体には model、state、questions が必要です——未知フィールドは上流へそのままパススルーされます。

4 言語のサンプル

curl
curl -X POST "https://api.easyjev.online/v1/systemone" \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "typesafe/jev-latest",
    "state": "User asks: can I get a refund for order #1024?",
    "questions": {
      "refund": {"type": "noul", "instructions": "Is this a refund request?"}
    }
  }'
Python · requests
import requests

resp = requests.post(
    "https://api.easyjev.online/v1/systemone",
    headers={"Authorization": "Bearer sk-your-key"},
    json={
        "model": "typesafe/jev-latest",
        "state": "User asks: can I get a refund for order #1024?",
        "questions": {
            "refund": {"type": "noul", "instructions": "Is this a refund request?"}
        },
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json()["answers"]["refund"]["noul"])  # e.g. 0.97
JavaScript · fetch
const resp = await fetch("https://api.easyjev.online/v1/systemone", {
  method: "POST",
  headers: {
    Authorization: "Bearer sk-your-key",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "typesafe/jev-latest",
    state: "User asks: can I get a refund for order #1024?",
    questions: {
      refund: { type: "noul", instructions: "Is this a refund request?" },
    },
  }),
});

const data = await resp.json();
console.log(data.answers.refund.noul); // e.g. 0.97
Go · net/http
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	payload, _ := json.Marshal(map[string]any{
		"model": "typesafe/jev-latest",
		"state": "User asks: can I get a refund for order #1024?",
		"questions": map[string]any{
			"refund": map[string]any{
				"type":         "noul",
				"instructions": "Is this a refund request?",
			},
		},
	})
	req, _ := http.NewRequest("POST", "https://api.easyjev.online/v1/systemone", bytes.NewReader(payload))
	req.Header.Set("Authorization", "Bearer sk-your-key")
	req.Header.Set("Content-Type", "application/json")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	var out struct {
		Answers map[string]struct {
			Noul float64 `json:"noul"`
		} `json:"answers"`
	}
	json.NewDecoder(resp.Body).Decode(&out)
	fmt.Println(out.Answers["refund"].Noul) // e.g. 0.97
}

レスポンスの読み方

回答は問題 id をキーに answers 配下に集まり、各項目は問題の type をエコーし、型固有のフィールド(noul 確率、choice と probabilities、補間された score、confidence)を伴います。課金メーターは usage 配下にあります。全フィールドの詳細は完全リファレンスを参照。

JSON · 200 OK
{
  "model": "typesafe/jev-latest",
  "answers": {
    "refund": {
      "type": "noul",
      "noul": 0.97,
      "confidence": 0.93
    }
  },
  "usage": {"input_tokens": 1234, "output_tokens": 0}
}