# Decisions (/docs/zh-CN/api/decisions)

`POST /v1/decisions` 提供 OpenAI Decisions，使用与对话相同的 Key：发送输入和带类型的问题，返回的不是生成的文本，而是带概率的结构化答案。支持的模型是 `openai/gpt-6-luna`。

| | |
|---|---|
| 端点 | `POST https://api.ohmygpt.com/v1/decisions` |
| 鉴权 | `Authorization: Bearer $OHMYGPT_API_KEY` |
| 模型 | `openai/gpt-6-luna` |
| 响应 | 非流式（一个 JSON 响应） |

```bash
curl https://api.ohmygpt.com/v1/decisions \
  -H "Authorization: Bearer $OHMYGPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-6-luna",
    "input": [{
      "type": "message",
      "role": "user",
      "content": [{"type": "input_text", "text": "I was charged twice for my subscription this month."}]
    }],
    "questions": [{
      "type": "choice",
      "name": "department",
      "instructions": "Which department should handle this?",
      "choices": [
        {"value": "billing", "description": "Payments and refunds."},
        {"value": "support", "description": "General support."}
      ]
    }]
  }'
```

```json
{
  "model": "gpt-6-luna",
  "answers": [
    {
      "type": "choice",
      "name": "department",
      "choice": "billing",
      "probabilities": [
        { "value": "billing", "probability": 1.0 },
        { "value": "support", "probability": 0.0 }
      ],
      "confidence": 1.0
    }
  ],
  "usage": {
    "input_tokens": 124,
    "input_tokens_details": { "cached_tokens": 0, "cache_write_tokens": 0 },
    "output_tokens": 0,
    "output_tokens_details": { "reasoning_tokens": 0 },
    "total_tokens": 124
  }
}
```

请求和响应与 OpenAI 的 Decisions 格式完全一致，所以 OpenAI 的示例只要换掉 Base URL、Key 和模型 ID 就能直接运行。Decisions 按输入 token 计费，和所有端点一样，每个响应的费用都在 `X-Cost-Credits` 响应头中。

## TypeSafe System One [#typesafe-system-one]

`POST /v1/systemone` 提供 TypeSafe System One，模型为 `typesafe/jev-latest`。请求和响应遵循 TypeSafe 的 System One 格式。可以发送 JSON，也可以发送 `multipart/form-data`：第一部分名为 `request`，内容是 JSON，之后每张图片各占一部分。以 `TypeSafe-Danger-Zone-` 开头的请求头会原样传给模型。
