接入你的第一个决策

保留在 Playground 中选择的模型与配置。创建 Key、复制代码,再查看第一次调用。

1. 选择模型

respan/span-01-lite

2. 创建 API Key

创建 API Key →

新用户赠送 100 credits · 网页与 API 共用余额

3. 在服务端运行

在服务端环境变量中设置 DECISION_API_KEY,将 YOUR_API_KEY 替换为你的密钥。不要放进浏览器代码或提交到代码仓库。

export DECISION_API_KEY="YOUR_API_KEY"

curl --fail-with-body 'https://decisionapi.org/v1/systemone' \
  -H "Authorization: Bearer $DECISION_API_KEY" \
  -H "Content-Type: application/json" \
  --data-raw '{
  "model": "respan/span-01-lite",
  "state": {
    "input": [
      {
        "role": "user",
        "content": "Please explain your refund policy."
      }
    ],
    "output": {
      "role": "assistant",
      "content": "You can request a refund within 30 days."
    }
  },
  "questions": {
    "helpful": {
      "type": "noul",
      "instructions": "Does the assistant answer the user question?",
      "criteria": {
        "true": "Answers the question",
        "false": "Does not answer the question"
      }
    }
  }
}'