0x01 400 requires adaptive thinking?
在 Claude Code 之外的 Agent 里接 Claude 分组,最容易撞到这条 400:
json
{
"error": {
"message": "claude-fable-5-2 requires adaptive thinking; omit thinking or use thinking.type=adaptive and output_config.effort",
"type": "invalid_request_error"
},
"type": "error"
}请求根本没到模型,是网关按上游要求退回来的。
原因
新一批 Claude 模型(Fable 5.x、Opus 5.x、Sonnet 5.x、Haiku 5.x)只接受自适应思考:
- 不再接受
thinking.type = "enabled"+budget_tokens(老式的固定预算); - 也不接受显式关闭思考,
thinking.type = "disabled"或客户端模板里的off档都会 400。
第三方 Agent 多半带着「思考开关」模板,一个 off 就等于替用户发了关闭思考,于是每条请求都挂。
通用改法
| 你想做的 | 该发什么 |
|---|---|
| 用默认强度 | 完全省略 thinking 字段 |
| 指定强度 | {"thinking":{"type":"adaptive"},"output_config":{"effort":"high"}} |
| 想关掉思考 | 做不到,用 effort: "low" 近似 |
DeepSeek Harness(DSH)
DSH 的模型配置里每档思考强度都要写具体值,off: null 会被翻译成一个「关闭思考」的字段。把 off 整行删掉,加 compat.forceAdaptiveThinking: true:
yaml
apiKeyEnv: CAP_DSH_API_KEY
api: anthropic-messages
baseURL: https://api.natie.dev # 走本地反代就填本地地址
models:
- id: claude-fable-5-2
name: claude-fable-5-2
maxTokens: 128000
compat:
forceAdaptiveThinking: true
reasoningEfforts:
low: low
medium: medium
high: high
xhigh: xhigh
max: max
input:
- text
- image
contextWindow: 1000000如果是json格式,那就改成
"claude-fable-5-2": {
"id": "claude-fable-5-2",
"name": "claude-fable-5-2",
"maxTokens": 128000,
"compat": {
"forceAdaptiveThinking": true
},
"reasoningEfforts": {
"low": "low",
"medium": "medium",
"high": "high",
"xhigh": "xhigh",
"max": "max"
},
"input": [
"text",
"image"
],
"contextWindow": 1000000,
"limit": {
"context": 1000000,
"output": 128000
},
"reasoning": true,
"modalities": {
"input": [
"text",
"image"
],
"output": [
"text"
]
}
},...claude-opus-5-5、claude-sonnet-5-5、claude-haiku-5-5 照抄,只换 id / name。要点只有两条:
reasoningEfforts里的off: null整行删掉,别留着写null;- 补上
compat: forceAdaptiveThinking: true。
改完重启 DSH。强度档位 low → max 都能用,只是没有「关闭思考」。
顺带确认
- 协议必须是 Messages(
api: anthropic-messages)。Claude 分组拒绝了 Responses 和 Chat Completions,协议填错会先撞别的错,不是这条 400。 - 模型 ID 以
GET /v1/models为准,配置里的id对不上会返回model not found,不是这条 400。