---
url: https://limapi.com/docs/guide/decision.md
---
# 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

| 字段 | 类型 | 必填 | 说明 |
|------|------|------|------|
| model | string | \* | 固定 `decision-model-preview`，传其它值 400 |
| state | string / object / array | \* | 待判定的业务上下文，不能为空。输入上限 65536 tokens |
| questions | object | \* | 键为自定义问题 ID，值为问题对象，**最多 16 个**、至少 1 个 |
| └ type | string | \* | `choice`（多选一）/ `noul`（是否判定）/ `score`（有序量表打分） |
| └ instructions | string | 可选 | 该问题的说明或评判提示 |
| └ criteria | object / 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` 外，每一类只出现自己那几个字段。

| 字段 | 出现于 | 说明 |
|------|--------|------|
| choice | choice | 选中的选项名 |
| noul | noul | 判定为"是"的概率，0~1 |
| score | score | 概率加权后的期望分值（落在等级下标区间内） |
| legend | score | 等级下标 → 描述文本的映射 |
| probabilities | choice / score | 每个选项或等级的概率分布 |
| confidence | choice / 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。
