错误排查

AI API 中转站错误排查

按错误码、常见原因和下一步检查项排查中转站 API 调用问题,先确认 Base URL、API Key、额度和模型配置,再决定是否更换中转站服务商。

网络 503

Claude Code / Codex 503 No available accounts:中转站账号池不可用排查

先不要盲目换 Key。这个错误通常说明账号池、供应商、分组或模型路由暂时不可用。先测最小请求、确认模型和分组,再判断是等待恢复、降低上下文,还是换 provider。

#claude code 503 no available accounts #codex 503 no available accounts #中转站 503
模型 model_at_capacity

Codex: Selected model is at capacity. 模型容量已满排查

报错:Selected model is at capacity. Please try a different model. 先把它当作模型级容量、Admission 或流式中断问题处理。它可能出现在官方 ChatGPT 登录态 Codex CLI,也可能来自中转站账号池或 Sub2API 上游 overloaded 透传。

#selected model is at capacity #codex selected model is at capacity #codex model at capacity
模型

Codex 提示:你的对话中有多个可能的网络安全风险的标记

提示:你的对话中有多个可能的网络安全风险的标记。先把它当作 OpenAI/Codex 安全路由触发,而不是直接判断账号或中转站故障;再检查是否使用了中转 API、敏感关键词、超长代码上下文或不透明模型路由。

#codex 网络安全风险 #你的对话中有多个可能的网络安全风险的标记 #trusted access for cyber
限流 429

Error 429 Too Many Requests:AI API 中转站限流排查

报错:exceeded retry limit, last status: 429 Too Many Requests, request id: <request-id>。AI 中转站里连续 429 多半是上游账号池限流、冷却或额度耗尽,先让服务商换号、换线路或换模型。

#error 429 #429 too many requests #openai api 429
认证 401

Error 401 Unauthorized:AI API 中转站认证排查

401 是认证失败信号。先检查当前加载的是哪一个 Key、请求打到哪个 Base URL、header 格式是否正确,以及这个 Key 是否仍然在对应 provider 中有效。

#error 401 #401 unauthorized #openai api 401
网络 origin_bad_gateway

中转站报错 API Error 502 origin_bad_gateway 排查步骤

报错:API Error 502、Error 502: Bad gateway、error_name: origin_bad_gateway、cloudflare_error: true。先看中转站状态页;如果目标模型或线路全红,停止反复改 Key 和重试,直接联系在线客服或站长确认号池与恢复时间。

#api error 502 origin_bad_gateway #error 502 bad gateway api #cloudflare_error true api
模型 cyber_policy

Codex 提示:此聊天已被标记为可能存在网络安全风险

Codex 提示“此聊天已被标记为可能存在网络安全风险”时,先不要把它当作中转站故障或封号。它更像是系统级网络安全风险标记;普通开发误触发时,优先新开会话、缩小上下文、重新表述任务。

#codex 此聊天已被标记为可能存在网络安全风险 #this chat was flagged for possible cybersecurity risk #trusted access for cyber
模型 model_not_supported_chatgpt_account

Codex: gpt-5.6-sol model is not supported with a ChatGPT account

报错:The 'gpt-5.6-sol' model is not supported when using Codex with a ChatGPT account. 先把它当作 ChatGPT 账号权限、订阅层级或灰度入口问题处理;可先切到 Terra/Luna,或改用 API Key/provider 配置。

#The 'gpt-5.6-sol' model is not supported when using Codex with a ChatGPT account #gpt-5.6-sol not supported ChatGPT account #codex gpt-5.6-sol not supported
配置 mcp_tool_not_available_in_session

Codex 找不到 MCP 工具:tool does not exist in this session's available toolset

Codex 提示 MCP tool does not exist in this session's available toolset 时,先核对服务和工具发现状态,再用全新会话、codex doctor、官方 provider 与版本 A/B 判断是缓存、客户端回归还是自定义 provider 没有暴露工具。

#codex tool does not exist in this session available toolset #codex mcp tool does not exist #codex mcp tools unavailable
配置 mcp_unexpected_response_type

Codex MCP 报错 Unexpected response type

Codex MCP 报 Unexpected response type 时,先确认错误发生在 tools/call 返回之后,再用 MCP Inspector、直接客户端或旧版 Codex 做对照;服务端可临时简化返回内容,普通用户则应保留版本和工具名等待兼容修复。

#codex mcp unexpected response type #codex tool call failed unexpected response type #codex mcp tool call error
模型

Codex:当前环境没有提供可用的终端或文件编辑工具怎么解决

先 fork 当前对话,在新任务中回复“继续”让 Codex 重新执行。如果仍然没有工具,用 GPT-5.5 和手动 `!命令` 做一次对照测试。

网络 stream_disconnected_error_sending_request

Codex 报错 stream disconnected before completion

Codex 报 stream disconnected before completion: error sending request for url 时,先不要急着换账号或改模型。它通常是终端网络、代理继承、中转站 Responses 兼容性或上游 SSE 流断开的信号。

#codex stream disconnected before completion #codex error sending request for url #stream disconnected before completion error sending request
网络 upstream_error

Codex 报错 stream disconnected before completion: Upstream request failed

Codex 报 stream disconnected before completion: Upstream request failed 时,不要只凭浏览器能上网就排除网络,也不要只凭 curl hello 能通就认定中转站没问题。先看 URL、upstream_error、response.failed、request id 和是否使用自定义 provider,再按官方链路、本地代理和中转站链路分开排查。

#codex stream disconnected before completion upstream request failed #stream disconnected before completion upstream request failed #codex upstream_error
配置 task_creation_timeout

Codex 报错 Error creating task: Timeout / Unable to start task

Codex 报 Error creating task: Timeout、Task creation timeout 或 Unable to start task 时,先测试已有任务,再临时禁用无法连接或路径失效的 MCP 服务并完全重启桌面端。

#codex error creating task timeout #codex task creation timeout #codex unable to start task