Skip to content

Decision 决策模型 ​

POST /api/v1/decisions
Authorization: Bearer sk-xxx
Content-Type: application/json

非对话形态的结构化判定入口:给它一段业务上下文(state)和一组问题定义(questions),返回每题的判定结果、置信度与概率分布。当前唯一模型 decision-model-preview,用于路由分派、工单分级、内容判定这类"只要一个决定、不要一段回答"的场景。

⚠ 这条路径不是 OpenAI 兼容接口:请求体没有 messages,响应没有 choices,也不支持流式、工具调用与批量。用 /chat/completions 调这个模型上游会直接回 400。

Request ​

字段类型必填说明
modelstring*固定 decision-model-preview,传其它值 400
statestring / object / array*待判定的业务上下文,不能为空。输入上限 65536 tokens
questionsobject*键为自定义问题 ID,值为问题对象,最多 16 个、至少 1 个
└ typestring*choice(多选一)/ noul(是否判定)/ score(有序量表打分)
└ instructionsstring可选该问题的说明或评判提示
└ criteriaobject / array视类型choice:{"选项名":"选项说明"} 对象(必给)
score:按序等级描述数组,至少一项(必给)
noul:可选,且必须是对象

请求示例(三类问题各一问):

json
{
  "model": "decision-model-preview",
  "state": {
    "ticket_id": "T-1001",
    "content": "用户反馈订单支付后超过 24 小时仍未到账,客服已安抚两轮。"
  },
  "questions": {
    "dept": {
      "type": "choice",
      "instructions": "应由哪个团队处理?",
      "criteria": { "billing": "支付与对账问题", "technical": "系统与故障问题" }
    },
    "esc": {
      "type": "noul",
      "instructions": "是否需要立即通知值班人员?"
    },
    "sev": {
      "type": "score",
      "instructions": "这个问题有多严重?",
      "criteria": ["轻微", "一般", "严重", "极严重"]
    }
  }
}

Response ​

answers 的键与请求里 questions 的键一一对应;除 type 外,每一类只出现自己那几个字段。

字段出现于说明
choicechoice选中的选项名
noulnoul判定为"是"的概率,0~1
scorescore概率加权后的期望分值(落在等级下标区间内)
legendscore等级下标 → 描述文本的映射
probabilitieschoice / score每个选项或等级的概率分布
confidencechoice / score本次判定的置信度
usage.input_tokens全部只有输入这一维,没有 output_tokens(它不生成文本)

响应示例:

json
{
  "model": "decision-model-preview",
  "request_id": "3f6a8c2e-1b7d-9a45-8f2c-6d0b1e5a4c99",
  "answers": {
    "dept": {
      "type": "choice",
      "choice": "billing",
      "confidence": 0.94,
      "probabilities": { "billing": 0.97, "technical": 0.03 }
    },
    "esc": { "type": "noul", "noul": 0.87 },
    "sev": {
      "type": "score",
      "score": 2.18,
      "confidence": 0.9,
      "legend": { "0": "轻微", "1": "一般", "2": "严重", "3": "极严重" },
      "probabilities": { "0": 0.01, "1": 0.05, "2": 0.7, "3": 0.25 }
    }
  },
  "usage": { "input_tokens": 77 },
  "latency_ms": 60.2
}

计费 ​

模型输入输出
decision-model-preview¥0.25 / 百万 tokens不计费

按上游返回的 usage.input_tokens 结算,一次典型三问判定约 70~80 tokens ≈ ¥0.00002。超出 65536 tokens 上限、或 questions 多于 16 个,网关在校验层直接回 400,不产生费用。

限制 ​

  • 单次最多 16 个问题;state 不能为空。
  • 不支持流式(stream)、函数/工具调用、批量接口。
  • 上游限流为 RPM 1200 / TPM 2,000,000,被打回时返回 429。

LimAPI — 大模型聚合网关