Skip to content
EASYJEV

HTTP 与 curl

用任意语言直调 POST /v1/systemone:curl、Python requests、Node fetch 与 Go 示例,附精确的 JSON 请求/响应结构。

端点

每次判定就是对 https://api.easyjev.online/v1/systemone 的一次 POST,带 Bearer sk- 密钥。认证头:Authorization: Bearer sk-...。JSON 请求体必须含 model、state、questions——未知字段原样透传上游。

四种语言示例

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}
}