参考

OpenAI Decisions API 文档

本站决策端点的参考文档,由本站运行的决策模型 decisions-1 提供服务。本站是独立的开发者服务——不是 OpenAI。

更新于

接口

向本站发送 POST /api/v1/decisions。没有 chat-completions 路径,也没有流式响应。GET /api/v1/models 列出模型 id。

POST https://decisions-api.net/api/v1/decisions
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

鉴权

把控制台密钥放在 Authorization: Bearer。缺失或被拒绝的密钥返回 401。试用台在你运行请求时,会为已登录账号创建密钥。

快速开始

把 DECISIONS_API_KEY 设为控制台里的密钥,然后发送下面的请求。新访客有 1 次免费调用,够 1 次成功请求。

curl https://decisions-api.net/api/v1/decisions \
  -H "Authorization: Bearer $DECISIONS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "decisions-1",
  "state": "Thanks for the refund. Still annoyed it took three emails.",
  "questions": {
    "sentiment": {
      "type": "choice",
      "instructions": "What is the overall sentiment of this message?",
      "criteria": {
        "positive": "Satisfied or thankful overall.",
        "mixed": "Both satisfied and unhappy.",
        "negative": "Unhappy overall."
      }
    },
    "needs_follow_up": {
      "type": "noul",
      "instructions": "Should a person reply to this message?"
    }
  }
}'

在 AI 编程工具中使用

复制一份包含完整请求约定的提示词,连同你的任务一起粘贴到 Cursor、Claude Code 或 ChatGPT。同样的参考内容也在 /llms.txt。

/llms.txt

请求体

model 为 decisions-1 或 decisions-latest。state 是字符串、JSON 对象或文本数组,最多 60,000 字符。questions 是 1 到 6 个 snake_case id 的映射。id 只是答案返回时的标签,不是问题本身。真正的问题写在 instructions,为 1 到 2,000 字符的文本。

{
  "model": "decisions-1",
  "state": "Thanks for the refund. Still annoyed it took three emails.",
  "questions": {
    "sentiment": {
      "type": "choice",
      "instructions": "What is the overall sentiment of this message?",
      "criteria": {
        "positive": "Satisfied or thankful overall.",
        "mixed": "Both satisfied and unhappy.",
        "negative": "Unhappy overall."
      }
    },
    "needs_follow_up": {
      "type": "noul",
      "instructions": "Should a person reply to this message?"
    }
  }
}

问题类型

Noul

type 为 noul 时只需要 instructions。答案字段 noul 是陈述为真的概率,从 0 到 1。没有单独的 confidence 字段。如果你在 noul 问题上发送 criteria,本接口会忽略它。

Choice

type 为 choice 时需要 instructions 和 criteria:2 到 8 个 snake_case 选项 id,各映射到最多 300 字符的说明。答案包含 choice、每个选项的 probabilities,以及 confidence。

Score

type 为 score 时需要 instructions,以及从低到高排列的 2 到 10 条档位说明。答案包含 score、你的档位 legend、probabilities 和 confidence。

响应

成功的响应体包含 model、以你的问题 id 为键的 answers、含 input_tokens 和 output_tokens 的 usage,以及 credits_used。即使发送 decisions-latest,model 也报告 decisions-1。下面是快速开始请求的示例响应,已省略 usage。

{
  "model": "decisions-1",
  "answers": {
    "sentiment": {
      "type": "choice",
      "choice": "mixed",
      "probabilities": { "mixed": 0.79, "negative": 0.2, "positive": 0.01 },
      "confidence": 0.61
    },
    "needs_follow_up": { "type": "noul", "noul": 0.83 }
  },
  "credits_used": 1
}

读懂概率和 confidence

Noul 是 instructions 中陈述为真的概率。Choice 和 Score 返回每个选项或档位的概率,外加 confidence。

第二名就是转人工的信号。当 confidence 低,或两个选项接近时,把这种情况交给人,或再问一个更具体的问题。看过这些接近的结果之前,不要调低截止值。

限制

项目本接口
接口POST /api/v1/decisions,Bearer 密钥
模型decisions-1(decisions-latest 是别名)
每次调用的问题数1 到 6
Choice 选项数2 到 8
Score 档位数2 到 10,最低档在前
State字符串、JSON 对象或数组,最多 60,000 字符
Instructions文本,1 到 2,000 字符
计费每次成功调用 1 积分;失败调用免费
流式输出不支持

OpenAI Decisions API:目前已公开的信息

OpenAI 在 2026-09-29 的 DevDay 上发布了其 Decisions API:由 GPT-6 Luna 专用版本驱动,接受文本或图像上下文、一个问题和一组有限答案,返回带置信度的答案。目前处于限量预览。

OpenAI 尚未公布其请求模式、SDK 方法、速率限制或定价。本页所有内容描述的都是本站端点——请勿把它当作 OpenAI 文档。待 OpenAI 的参考文档发布后,上面的字段描述的也是同一决策模式:上下文输入,你的答案之一输出。

本站端点与 OpenAI Decisions API 的区别

OpenAI 的 Decisions API 是独立的有限预览产品,其请求与响应结构尚未公布。本站提供的是建立在同一决策模式上的独立端点——状态、类型化问题、带逐选项概率的答案。

  • 输入:OpenAI 的公告描述支持文本或图片上下文;本端点仅接受文本——字符串、JSON 对象或文本数组,最长 60,000 字符。
  • 模型 ID:发送 decisions-1 或 decisions-latest。像 decisions-1.0 这样的版本化 ID 会返回 422。
  • 答案:OpenAI 描述为一个答案加置信度;本端点按问题 ID 各返回一个答案,并给出每个选项或档位的概率。
  • 可用性:OpenAI 的 Decisions API 处于有限预览;本端点今天即可用控制台中的密钥调用。
  • 计费:本站每次成功调用消耗 1 积分,与 token 数无关。OpenAI 尚未公布 Decisions API 的定价。

错误

  • 401 — 缺少或被拒绝的 API 密钥。
  • 402 — 密钥有效,但余额不够这次调用。上游失败不会扣积分。
  • 422 — 请求体校验失败。消息会指出字段。
  • 429 — 决策服务被限流。稍后再试。
  • 502 — 决策服务没有返回答案。不扣积分。

模型 id

此 API 由 decisions-1 提供。当代码中的阈值依赖某个固定概率分布时,请发送该 ID。decisions-latest 是此 API 上同一 ID 的别名。

OpenAI Decisions API 对比 Jev