OpenAI reasoning.effort "Unsupported value"(unsupported_value)原因与修复
在代码或 Codex CLI 里把思考强度设成 none、minimal 或 max,结果收到 HTTP 400,提示该模型不支持此档位并附带一串 Supported values are: ...。本文梳理主力 GPT 模型的真实可用档位表与防踩坑写法。
一句话结论
unsupported_value 说明该模型支持 reasoning.effort(Responses)或 reasoning_effort(Chat Completions),只是不接受你传的这一档——最典型的坑是给 gpt-6.2-sol、gpt-6.2-astra、gpt-6.1-sol 或 gpt-6-astra 传了 none 或 minimal。改成报错信息列出的合法值(通常首选 low),并在多模型切换时按模型做档位映射即可。
报错原文与两个易混错误
{
"error": {
"message": "Unsupported value: 'none' is not supported with the 'gpt-6-astra' model. Supported values are: 'low', 'medium', 'high', 'xhigh', and 'max'.",
"type": "invalid_request_error",
"param": "reasoning.effort",
"code": "unsupported_value"
}
}看懂两条关键信息就能立刻修好:
message里直接写明了目标模型名与全部合法档位——直接从Supported values里挑一个填回去即可通过校验。- 区分
unsupported_value与unsupported_parameter: 如果code变成unsupported_parameter,说明当前模型根本不是推理模型,直接把整个reasoning/reasoning_effort字段去掉。
主力 GPT 模型支持档位速查表
对照 OpenAI 官方模型文档(省略该参数时默认均为 medium):
| 模型 ID | none | minimal | low | medium | high | xhigh | max |
|---|---|---|---|---|---|---|---|
gpt-6.2-sol / gpt-6.2-astra | — | — | ✓ | ✓(默认) | ✓ | ✓ | ✓ |
gpt-6.1-sol / gpt-6-astra | — | — | ✓ | ✓(默认) | ✓ | ✓ | ✓ |
gpt-6-sol / gpt-6-luna | ✓ | — | ✓ | ✓(默认) | ✓ | ✓ | ✓ |
gpt-5.6-sol | ✓ | — | ✓ | ✓(默认) | ✓ | ✓ | ✓ |
可以看到,旧代码遗留的 minimal 在当前主力模型上均已不再列出;而 none 仅在部分通用款上保留,编程与深度推理向的 6.2、6.1-sol 与 6-astra 一律最低从 low 起跳。
修复 1:按接口传入合法档位(推荐 low 替代 none / minimal)
Responses API(/v1/responses):
curl https://byesu.com/v1/responses \
-H "Authorization: Bearer sk-YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6.2-sol",
"input": "找出这段循环的越界 bug:for i in range(1, len(xs)): print(xs[i])",
"reasoning": {"effort": "low"}
}'Chat Completions(/v1/chat/completions):
curl https://byesu.com/v1/chat/completions \
-H "Authorization: Bearer sk-YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6.2-sol",
"messages": [{"role": "user", "content": "找出越界 bug:for i in range(1, len(xs)): print(xs[i])"}],
"reasoning_effort": "low"
}'联动提醒:一旦把档位从
none调到low或更高,请确保请求里没有残留temperature或top_p,否则会紧接着触发unsupported_parameter报错。
修复 2:多模型代码使用自动就近降级/升级字典
如果你的网关封装允许用户在多个 GPT 模型之间自由切换,不要全局写死一个 effort:
LEVELS = ["none", "minimal", "low", "medium", "high", "xhigh", "max"]
SUPPORTED = {
"gpt-6.2-sol": {"low", "medium", "high", "xhigh", "max"},
"gpt-6.2-astra": {"low", "medium", "high", "xhigh", "max"},
"gpt-6.1-sol": {"low", "medium", "high", "xhigh", "max"},
"gpt-6-astra": {"low", "medium", "high", "xhigh", "max"},
"gpt-6-sol": {"none", "low", "medium", "high", "xhigh", "max"},
"gpt-6-luna": {"none", "low", "medium", "high", "xhigh", "max"},
"gpt-5.6-sol": {"none", "low", "medium", "high", "xhigh", "max"},
}
def pick_effort(model: str, wanted: str) -> str | None:
allowed = SUPPORTED.get(model)
if not allowed:
return None # 未知模型交由服务端默认档处理
if wanted in allowed:
return wanted
idx = LEVELS.index(wanted)
for candidate in LEVELS[idx + 1:] + LEVELS[:idx][::-1]:
if candidate in allowed:
return candidate
return None修复 3:Codex CLI 切换模型后的配置检查
在 Codex CLI 中,思考强度由 ~/.codex/config.toml 里的 model_reasoning_effort 控制。如果你之前跑 gpt-6-sol 时配了 model_reasoning_effort = "none",后来切到 gpt-6.2-sol 或 gpt-6-astra,每一轮都会稳定报 400。改成 "low"、"medium" 或 "high" 即可(完整配置见 Codex CLI 接入教程)。
常见问题
报错 Unsupported value: 'none' is not supported with the model 是什么意思?
说明当前模型不允许关闭推理思考(不支持 none)。改成 low 或 medium 即可通过校验。
reasoning_effort 和 reasoning.effort 混用会报错吗?
在 /v1/chat/completions 上必须写顶层 "reasoning_effort": "high";在 /v1/responses 上必须写 "reasoning": {"effort": "high"},混写会被忽略或报未知字段。