接入你的第一个决策

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

1. 选择模型

laya-english

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": "laya-english",
  "state": "I was charged twice for order A-4471. Please refund the duplicate payment.",
  "questions": {
    "route": {
      "type": "choice",
      "instructions": "Which team should handle this ticket? Use other when no option fits.",
      "criteria": {
        "billing": "Payments, charges and refunds",
        "technical": "Bugs and product errors",
        "account": "Login and account access",
        "other": "None of these teams"
      }
    }
  }
}'