MoeRouter 文档 获取 API Key

报错对照表

按状态码和错误码查 MoeRouter 返回的报错:每一条的原文、含义和处理办法。可以用页面顶部的搜索直接粘贴报错原文。

更新于 2026-11-15 阅读约 8 分钟

本页目录
  1. 先看这三样
  2. 401:Key 的问题
  3. 403:余额、额度或权限
  4. insufficient_user_quota
  5. pre_consume_token_quota_failed
  6. Key 所属的分组不能用
  7. Key 限制了可用模型
  8. IP 不在白名单里
  9. request_blocked
  10. 404:模型或接口不对
  11. model_not_found
  12. model_endpoint_not_supported
  13. 路径不对
  14. 400:请求内容要改
  15. stateful_request_not_supported
  16. unsupported_value
  17. context_length_exceeded
  18. content_policy_violation
  19. 工具定义或工具记录有问题
  20. 请求体的问题
  21. Claude Code 相关
  22. client_version_unsupported
  23. claude_code_required
  24. 429:请求太快
  25. rate_limit_exceeded
  26. 5xx:线路的问题
  27. model_temporarily_unavailable(503)
  28. upstream_unavailable(503)
  29. overloaded_error(503、529)
  30. upstream_timeout(504、524)
  31. upstream_error(500、502)
  32. websocket_not_supported(426)
  33. 还是解决不了

先看这三样#

出错时的响应里有三样东西,先找到它们:

  • 状态码:401、404、503 这样的数字。
  • 错误码:响应体里的 error.code,例如 model_not_found。Messages 接口上有时在 error.type 里。
  • 提示:error.message。它会说明原因,多数还会直接告诉你怎么改。

提示是英文还是中文,取决于客户端声明的语言。本页列的是英文原文,方便对照和搜索。

一个粗略的判断:

状态码 谁的问题 重试有用吗
400、404、413 请求本身要改 没用,改了再发
401、403 Key、余额或权限 没用,先处理账号或 Key
429、503、529 线路暂时忙 有用,按 Retry-After 等一会儿
500、502、504、524 上游出错或超时 稍后重试,长请求改用流式

401:Key 的问题#

Key 无效、已删除、已禁用或已过期。逐项检查:

  • Key 有没有复制完整,前后有没有多出空格或引号;
  • 是不是把别的工具的令牌当成了 MoeRouter Key。经过 Magpie、AstrLink 这类本地网关时,客户端填的是它们自己的本地令牌,MoeRouter Key 填在网关里;
  • 环境变量里有没有旧的值在起作用。Claude Code 同时设了 ANTHROPIC_API_KEY 和 ANTHROPIC_AUTH_TOKEN 时,旧值可能盖掉新值;
  • 改完配置有没有开新的终端或者重启客户端。

403:余额、额度或权限#

insufficient_user_quota#

Your account balance is insufficient. Top up your account or contact the administrator.

账户余额不足:余额已经用完,或者不够这一次请求。到钱包充值。

pre_consume_token_quota_failed#

This API key has used up its quota, or has too little left for this request.
Raise the key's quota in the console or use another key.

账户有余额,但这个 Key 自己的额度用完了,或者剩下的不够这一次请求。在控制台编辑这个 Key,调高额度,或者换一个 Key。两者的区别见计费与额度。

Key 所属的分组不能用#

This API key is set to group …, which your account cannot use (the group may have been retired).
Edit the key in the console and choose another group.

Key 所属的分组已经下线,或者你的账号不能用它。编辑这个 Key,改选一个现有的分组,见分组与倍率。

Key 限制了可用模型#

This API key is limited to certain models and … is not one of them.
Edit the key's model limits in the console, or use another key.

这个 Key 在“高级设置”里开了模型限制,请求的模型不在名单里。把模型加进名单,或者换一个没有限制的 Key。

IP 不在白名单里#

Your IP address is not on this token's allowlist

这个 Key 设了 IP 白名单,而请求来自名单之外的地址。换了网络、开了代理之后常见。

request_blocked#

This conversation is temporarily blocked because the model refused a request in it.
Start a new conversation to continue, or retry this one in about an hour. Your API key is fine.

上游的模型服务拒绝了这段对话里的某个请求,随后暂时拦截了整段对话。Key 和账号没有问题。开一个新会话继续;同一段对话大约一小时后可以再试。

同一个错误码下还有两种提示:重复发送同一条测试消息被暂时拦截(正常对话不受影响,不要反复重发),以及请求被上游的策略拦截(不要原样重发,改写后再试)。

404:模型或接口不对#

model_not_found#

Model gpt4 does not exist or is not offered to this API key (group default).
GET /v1/models lists the models this key can use.

模型名写错了,或者这个模型已经下线。从模型广场复制模型 ID,注意大小写、连字符和小数点,例如 gpt-6.1-sol、claude-opus-5-5。

Model claude-fable-5-2 is not offered to API keys of group default. It is offered in: stable.
Change this key's group in the console, or create a key in one of those groups.

模型存在,但不在这个 Key 的分组里。按提示改 Key 的分组,或者在那个分组下新建一个 Key。

model_endpoint_not_supported#

Model claude-opus-5-5 is not offered on OpenAI Chat Completions (/v1/chat/completions) for this API key.
Call it on: Anthropic Messages (/v1/messages).

模型不支持你用的这种接口。提示里“Call it on”后面列的就是它支持的接口。

最常见的情况是用聊天客户端或 OpenAI SDK 调用只提供 Messages 接口的 Claude 模型。处理办法见接口与协议。

路径不对#

提示里出现 /v1/v1/…,或者 Invalid URL:接口地址多写或少写了 /v1。对照接口地址表。

400:请求内容要改#

stateful_request_not_supported#

Model gpt-6.1-terra cannot take this request: it carries encrypted reasoning, compaction or
item-reference items from an earlier response, which none of this model's routes can read.
Coding agents such as Codex send these from the second turn on: start a new session with a
model that takes them. Models that take such requests here: gpt-6-astra, gpt-6.1-sol.

请求要接续上一轮留在上游的状态,而这个模型的线路做不到。有三种情况,提示里会说是哪一种:

提示里的说法 原因 处理
carries encrypted reasoning… 请求带着上一轮的加密推理内容,Codex 这类 Agent 会带 换成提示里列出的模型,开新会话
continues a stored response (previous_response_id) 用 previous_response_id 接续 把完整对话放进 input 发送,或换模型
asks for background mode 请求了后台模式 去掉 "background": true

unsupported_value#

This model does not accept the value 'none' for one of the request's options.
It accepts: 'low', 'medium', 'high'.

某个参数的值这个模型不接受,常见的是推理强度。改成提示里列出的值,或者去掉这个参数。

Model … is offered here only with enable_thinking set to false; this request sets it to true.
Remove the parameter or change its value.

这个模型在这里只提供某一种设置。去掉这个参数,或者改成提示里的值。

context_length_exceeded#

The input exceeds this model's context limit. Shorten the conversation or attachments, or start a new session.

输入超过了模型的上下文上限。开新会话,压缩历史,或者减少附件。

content_policy_violation#

The request was declined by a content safety check. Rephrase or remove the flagged content
before retrying; repeated attempts can get the account restricted.

请求内容被上游的内容安全检查拒绝。改写或者去掉被拒绝的内容再试。不要原样反复重发:连续触发可能导致账号被限制。

工具定义或工具记录有问题#

错误码 原因 处理
invalid_tool_schema 某个工具的 input_schema 不符合 JSON Schema draft 2020-12 更新或暂时禁用对应的 MCP 服务或自定义工具,然后开新会话
unsupported_tool_schema 工具的参数定义用了这个模型不接受的写法,例如 anyOf 和其他关键字并列、枚举值不是字符串。提示里会给出工具名 简化那个工具的参数定义,或者禁用它
invalid_tool_history 工具调用和工具结果对不上 每个工具调用都要有对应的结果;或者开新会话
invalid_system_message 系统消息是空的或者格式不对 把系统提示放在顶层的 system 字段里,去掉空的系统消息
previous_response_not_found、invalid_encrypted_content 上一轮的响应或加密状态已经不可用 重新发送完整对话,或者开新会话

请求体的问题#

提示 原因
The request body could not be read as JSON… 请求体不是合法的 JSON,被截断了,或者压缩方式和 Content-Encoding 不一致
The request body is incomplete… 连接在请求体传完之前断开了,或者请求体比 Content-Length 声明的短
The request was rejected. Check the model parameters and request body format. 上游拒绝了这个请求,但没有给出能归类的原因。检查参数名、参数类型和模型是否支持这些参数
The request body is too large…(413) 请求体太大。减小附件,或者拆成几个请求

Claude Code 相关#

client_version_unsupported#

Claude Code 2.1.250 does not support this model; version 2.1.280 or newer is required.
Run 'claude update', or update the Claude desktop app, then restart it.

Claude Code 版本太旧。执行 claude update 后重开会话。第三方应用内置了自己的 Claude Code SDK 时,要更新那个应用。

claude_code_required#

This model requires the official Claude Code client using /v1/messages.
Generic API probes and /v1/chat/completions are not supported.

这条线路只接受 Claude Code 客户端。在 Claude Code 里直接发消息验证,不要用通用的“测速”或接口探测来判断它能不能用。

429:请求太快#

rate_limit_exceeded#

The request rate limit was reached. Reduce request frequency or concurrency and retry later.

线路在限流。MoeRouter 会先换别的线路重试,换过之后仍然不行,才把 429 返回给你。

  • 响应里有 Retry-After 就照它等;
  • 降低并发,不要高频重放同一个请求;
  • 持续出现时,换一个模型,或者换一个时间段。

5xx:线路的问题#

model_temporarily_unavailable(503)#

Model kimi-k2.6 is temporarily unavailable: its routes are busy or resting after an upstream error.
Retry in 20 s.

这个模型的线路都在休息或者满载。响应带着 Retry-After,等提示里的秒数再试即可。多数客户端会自动处理。原理见动态路由。

upstream_unavailable(503)#

This model's service is unavailable. Retry later or contact the administrator.

这个模型的上游服务暂时不可用。和你的 Key、余额无关,稍后重试。持续出现请告诉我们。

overloaded_error(503、529)#

The model service is temporarily busy. Retry after a short delay.

上游过载。等几秒再试。

upstream_timeout(504、524)#

The model request timed out. Retry later; for a large request, reduce the context or output length.

上游超时。

  • 长请求改用流式输出。非流式请求在生成完之前没有任何数据返回,等得太久会被中途断开;
  • 减小上下文,或者限制输出长度;
  • 推理强度设得很高的请求耗时会长很多。

upstream_error(500、502)#

The upstream service could not complete the request. Please try again.

上游返回了错误,没有更具体的原因。重试一次;持续出现请告诉我们。

websocket_not_supported(426)#

The Responses WebSocket is not offered here. Send requests over HTTP: POST /v1/responses.

Responses 接口目前只提供 HTTP。Codex 收到这个回复会自动改走 HTTP,不需要处理。自己写的客户端请直接用 HTTP。

还是解决不了#

到确认成功与排错清单按步骤检查一遍。仍然有问题,加 QQ 群 124786532 联系我们,并带上这三样:

  • 出错的大致时间;
  • 模型名和你用的客户端;
  • 提示末尾的 request id,或者响应头里的 X-Oneapi-Request-Id。

不要把 API Key 发到群里。

↑↓ 选择Enter 打开可以直接粘贴报错原文