文档参考报错对照
报错对照
找到你收到的那条报错。每一条都写了 HTTP 状态码、报错原文、什么时候会出现,以及怎么改。
怎么看报错
每个响应都带 X-Oneapi-Request-Id 这个响应头,大多数报错正文最后也会写 (request id: …),这就是请求 ID。找我们的时候,请把它一起发来。
报错一般是 OpenAI 的格式。例外是 Messages 请求在处理过程中出的错,用的是 Anthropic 的格式:
- 报错原文是英文,金额是美元,比如
$0.00。控制台语言切成中文的账户,个别报错会显示成中文;对不上原文时,按状态码和 code 查。 - 下面用 浅蓝底 标出的是运行时才填进去的内容;结尾的
(request id: …)省略不写。 - 如果报错里没有请求 ID,比如拿回来的是一张 HTML 网页,或者是流式输出里的一个事件,请把响应头
X-Oneapi-Request-Id发给我们。
400 请求有误
请求本身写得不对。
Invalid request: Invalid request: invalid JSON request body
- 什么时候
- 请求正文不是合法的 JSON。
- 怎么办
- 检查引号和逗号。在终端里,用单引号把 JSON 包起来,或者从文件里读。
Model name not specified, model name cannot be empty
- 什么时候
- 正文里没有
model,或者没有按 JSON 发送。 - 怎么办
- 加上
model。发送时带上Content-Type: application/json;不带的话,curl -d发的是表单。
field messages is required
- 什么时候
- 少了必填字段,报错里写着是哪一个。
- 怎么办
- 把那个字段补上。
Model 模型 has no price configured yet, so it cannot be used. Contact support if you need it enabled.
- 什么时候
- 这个模型暂时还不能用。
- 怎么办
- 换一个模型,或者写信告诉我们。
responses to chat conversion does not support stateful fields: previous_response_id
- 什么时候
- Responses 请求带了
previous_response_id,这个模型不支持。 - 怎么办
- 每次请求都把完整的对话放进
input。
The request was rejected as invalid. Check the request parameters and try again.
- 什么时候
- 模型服务那边认为某个参数不对,code 是对方的。
- 怎么办
- 检查发给这个模型的参数,比如
tool_choice或max_tokens。
其他 400 报错来自模型服务那边,用的是对方的原话;对方的请求 ID 会去掉,换成我们的。按报错里说的参数改就行。
401 未通过验证
Key 没带,或者不被接受。
Invalid token
- 什么时候
- 没带 Key、Key 不对,或者 Key 已停用、已过期、额度用完。这些情况都是同一句。
- 怎么办
- 去 API 密钥重新复制完整的 Key,并在那里看它的状态、过期时间和额度。用 Claude Code 的,再删掉以前设过的
ANTHROPIC_API_KEY。
403 被拒绝
Key 没问题,但余额或 Key 的设置挡住了这次请求。
Insufficient balance: 金额 remaining. New requests are declined until you add balance
- 什么时候
- 余额是 $0.00 或更少。这类请求不会记进使用日志。
- 怎么办
- 到钱包充值。余额一变成正数,你的 Key 马上就能用。
Insufficient balance: 金额 remaining, and this request needs 金额 reserved before it starts. Add balance or send a smaller request
- 什么时候
- 余额不多,不够这次请求的预估费用。余额和 Key 的额度都在 $10 以上时,不会提前预留。
- 怎么办
- 充值,或者少发一些输入 token。
token quota is not enough, token remain quota: 金额, need quota: 金额
- 什么时候
- 这把 Key 自己的额度不够这次请求。
- 怎么办
- 在 API 密钥里调高这把 Key 的额度 (USD),或者打开无限配额,也可以换一把 Key。
This token has no access to model 模型
- 什么时候
- 这把 Key 设了模型限制,这个模型不在里面。
- 怎么办
- 把这个模型加进 Key 的模型限制,或者清空限制,让它能调所有模型。
Your IP address IP is not on this key's IP allowlist
Your IP address could not be determined, so this key's IP allowlist cannot be checked
- 什么时候
- 这把 Key 设了 IP 白名单(支持 CIDR 表达式)。
- 怎么办
- 把报错里显示的 IP(或者一个 CIDR 网段)加进这把 Key 的 IP 白名单,或者清空白名单。
Selecting a channel with a key suffix is reserved for administrators; use the API key exactly as shown in the console
- 什么时候
- Key 后面多了一段以连字符开头的字符。
- 怎么办
- 照控制台上显示的样子,重新复制 Key。
This key's group '分组' is not available to your account
The group '分组' on this key has been retired; edit the key and choose another group
- 什么时候
- 这把 Key 选的分组不能用。
- 怎么办
- 在 API 密钥里编辑这把 Key,换一个分组。
User has been banned
- 什么时候
- 账户被停用。
- 怎么办
- 写信到 developer@acctoken.com。
404 找不到
模型 ID 不对,或者路径不对。
No available channel for model 模型 under group 分组 (distributor). Models available here: 可用的模型. Set your client to one of these (and make sure the name has no stray spaces)
- 什么时候
- 这里没有这个模型 ID,常见原因是工具还用着它自带的默认名。走 Messages 接口时,同样的话会以
not_found_error返回;Claude Code 里显示为There's an issue with the selected model。 - 怎么办
- 把模型改成报错里列出的某个 ID,参见模型 ID。
Invalid URL (方法 路径)
- 什么时候
- 路径不对:
/v1写了两次、请求方法不对,或者这个接口没有提供,比如count_tokens。 - 怎么办
- 去快速上手核对你的工具该用哪种 Base URL。
No response found with id 'ID'.
- 什么时候
- 用
GET /v1/responses/{id}取以前的返回结果时。我们不保存这些结果。 - 怎么办
- 自己保存好返回结果,每次请求都带上完整的输入。
429 请求太多
放慢一点再试。429 从来不是余额的问题;余额用完是 403。
The upstream model service is at capacity and could not take this request. This is a shared upstream limit, not your balance, your key or your parameters. Please retry shortly.
- 什么时候
- 模型服务那边容量满了。
- 怎么办
- 用指数退避重试,或者先换一个模型。
This model is at capacity. Requests above your fair share are rate limited so that everyone keeps access; this is not about your balance or your key. Retry in 数字 seconds or use another model.
- 什么时候
- 繁忙的模型会在各账户之间平均分配,会带
Retry-After头。 - 怎么办
- 等它写明的秒数,或者换一个模型。
Rate limit reached: up to 数字 successful requests every 数字 minutes. Please retry later
Rate limit reached: up to 数字 requests every 数字 minutes, failed ones included. Check that your requests are valid, then retry later
- 什么时候
- 你的账户对某个模型发得太快了。
- 怎么办
- 慢一点。如果很多请求本身就失败,先把它们修好:失败的也算次数。
Too many requests from your IP address. Please wait and retry; the Retry-After header says how long
- 什么时候
- 同一个 IP 发得太多。
- 怎么办
- 按
Retry-After写的时间等一等。
模型服务自己的 429 会原样转给你,并加上我们的请求 ID。
500、501、503
我们这边或者模型服务那边出了问题。
upstream error: do request failed
- 什么时候
- 连不上模型服务,或者流式请求 180 秒内没有收到响应。
- 怎么办
- 重试。一直这样的话,把请求 ID 发给我们。
Failed to get available channel for model 模型 under group 分组 (retry): 详情
No available channel for model 模型 under group 分组 (retry)
- 什么时候
- 重试的时候,这个模型暂时没有可用的服务。
- 怎么办
- 过一会儿再试,或者换一个模型。
not implemented
- 什么时候
- 用 Responses 接口调了一个服务方不支持它的模型。
- 怎么办
- 这个模型改用 Chat Completions。
Database error, please contact the administrator
- 什么时候
- 我们这边出了内部错误。
- 怎么办
- 重试,然后带着请求 ID 写信给我们。
API not implemented
- 什么时候
- 文件、微调和图片变体这几个接口没有提供。
- 怎么办
- 换别的办法做这件事,这些接口不提供。
No available channel for model 模型 under group 分组 (distributor). Models available here: …
- 什么时候
- 模型存在,但暂时用不了。
- 怎么办
- 过一会儿再试,或者换列表里的另一个模型。
Failed to get available channel for model 模型 under group 分组 (distributor): 详情
- 什么时候
- 为这次请求挑选服务时出错了。
- 怎么办
- 重试。一直这样的话,带着请求 ID 写信给我们。
system cpu overloaded (current: 数字%, threshold: 数字%)
- 什么时候
- 网关负载太高,正在自我保护。内存和磁盘也有同类报错。
- 怎么办
- 稍等一会儿再试。
This model is temporarily unavailable. This is a service-side problem, not your API key or your balance; please retry later or use another model.
- 什么时候
- 这个模型的服务方暂时提供不了。走 Messages 接口时,type 是
overloaded_error。 - 怎么办
- 过一会儿再试,或者换一个模型。这从来不是你的 Key 或余额的问题。
The model service returned an error. Please retry shortly.
- 什么时候
- 模型服务那边返回了别的错误,状态码沿用对方的。
- 怎么办
- 稍后重试。一直这样的话,把请求 ID 发给我们。
502 或 504 如果是一张 HTML 网页,那是网关前面那层网页服务器返回的,没有请求 ID。重试;一直这样的话,告诉我们出错的时间和接口。
流式输出里的报错
The upstream ended the response without any content, usually an early stop when it is at capacity. You were not charged; please retry.
- 什么时候
- Responses 的流式输出没有任何内容就结束了,以
response.failed事件返回。 - 怎么办
- 重试。
Chat Completions 或 Messages 流式输出里的其他报错,是模型服务自己的事件,原样转给你。
没有报错原文
Unexpected token '<'
- 什么时候
- 客户端收到的是一张 HTML 网页:Base URL 少了
/v1,请求落到了网站上。 - 怎么办
- OpenAI 格式的工具用
https://intl.acctoken.com/v1。
回复是空的
- 什么时候
- 有的模型会先思考再回答,思考也算进
max_tokens。上限设得太小,可能还没写正文就用完了。 - 怎么办
- 把
max_tokens调到 4096 以上,或者干脆不设。
请求超时
- 什么时候
- 有的模型(尤其是 GPT)不用流式输出时,长回答最多要三分钟左右才返回,你的客户端先不等了。
- 怎么办
- 把客户端的超时设成 300 秒以上,或者改用流式输出。
还是不行
- 余额大于 $0.00。
- Key 是完整的,前后没有多余的字符。
- 这把 Key 的模型限制里有这个模型,或者没设限制。
- Base URL 和工具的格式对得上:根地址,或者根地址加
/v1。 - 模型 ID 和模型广场上的写法一致。
- 用同样的值,跑快速上手里的 cURL 命令能通。能通的话,问题出在工具的设置上。
写信到 developer@acctoken.com,附上完整的返回内容和里面的请求 ID。我们 24 小时内回复。