错误
API 返回的所有错误:为什么会发生、该怎么处理,以及是否应该重试。
每个错误的返回体中都带有一个稳定的 code,结构遵循各格式自己的格式。请根据 code 分支处理,不要依赖消息文本:消息的措辞可能会变。
41 / 41
401invalid_api_key密钥错误或缺失先修正
- 何时出现
- 密钥缺失、输错、不存在或已撤销。在调用开始时被撤销的密钥,会在预留阶段被拒绝。
- 处理方法
- 以
Authorization: Bearer binf_...或x-api-key: binf_...发送完整的密钥。如果密钥已被撤销,请创建一个新的。 - 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "Missing or malformed API key. Send your binf_ key as `Authorization: Bearer <key>` or `x-api-key`.", "type": "authentication_error", "code": "invalid_api_key", "param": null }}{ "type": "error", "error": { "type": "authentication_error", "message": "Missing or malformed API key. Send your binf_ key as `Authorization: Bearer <key>` or `x-api-key`.", "code": "invalid_api_key" }}403agent_inactiveAgent 尚未启用先修正
- 何时出现
- Agent 的发射尚未在链上确认,或者发射费尚未支付。
- 处理方法
- 在 Agent 的页面上完成发射。页面显示 Agent 已上线后,密钥就可以使用。
- 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "This agent is not active yet. Activate it on its page to use the gateway.", "type": "permission_error", "code": "agent_inactive", "param": null }}{ "type": "error", "error": { "type": "permission_error", "message": "This agent is not active yet. Activate it on its page to use the gateway.", "code": "agent_inactive" }}403agent_suspendedAgent 已被暂停先修正
- 何时出现
- 该 Agent 已被暂停。它的所有密钥都无法发起调用。
- 处理方法
- 联系 bInference。
- 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "This agent is suspended.", "type": "permission_error", "code": "agent_suspended", "param": null }}{ "type": "error", "error": { "type": "permission_error", "message": "This agent is suspended.", "code": "agent_suspended" }}403agent_pausedAgent 已在驾驶舱中暂停先修正
- 何时出现
- Agent 的所有者在它的驾驶舱中点击了暂停。它的所有密钥都无法发起调用,它的 hooks 也会拒绝它的交易。
- 处理方法
- 在 binference.io 上 Agent 的驾驶舱中恢复它,需要最近 10 分钟内用钱包登录过。
- 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "This agent's owner paused it on binference.io. Resume it from the agent's cockpit there.", "type": "permission_error", "code": "agent_paused", "param": null }}{ "type": "error", "error": { "type": "permission_error", "message": "This agent's owner paused it on binference.io. Resume it from the agent's cockpit there.", "code": "agent_paused" }}400invalid_request请求体有误先修正
- 何时出现
- 请求体不是 JSON,或者缺少该格式需要的字段,比如
model或messages。模型的服务商也可能以同样的方式拒绝某个参数。 - 处理方法
- 对照接口的参考文档检查请求体,并对照模型检查参数。
- 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "The request body is not valid JSON.", "type": "invalid_request_error", "code": "invalid_request", "param": null }}{ "type": "error", "error": { "type": "invalid_request_error", "message": "The request body is not valid JSON.", "code": "invalid_request" }}400unknown_model未知模型先修正
- 何时出现
- 没有任何列出的模型使用这个 ID。在 POST /images 上,则是没有图像模型使用它。
- 处理方法
- 从 GET /models 或模型页面复制一个 ID;如果是图像,从 GET /images/models 复制。ID 的格式类似
anthropic/claude-sonnet-5.5。 - 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "Unknown model `openai/gpt-9`. Every model we serve is listed at /api/v1/models.", "type": "invalid_request_error", "code": "unknown_model", "param": null }}{ "type": "error", "error": { "type": "invalid_request_error", "message": "Unknown model `openai/gpt-9`. Every model we serve is listed at /api/v1/models.", "code": "unknown_model" }}400invalid_fallback不支持的备用模型先修正
- 何时出现
- 把由厂商直接提供的模型列为备用模型,或给它配备用模型;在
models或fallbacks中写了 bRoute;或调用 bRoute 时自带了备用列表。 - 处理方法
- 只把 bRoute 写在
model中:它会自己选择模型和备用模型。由厂商直接提供的模型请单独调用。 - 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "`broute/coding` is a bRoute: it can be the call's `model`, never a fallback.", "type": "invalid_request_error", "code": "invalid_fallback", "param": null }}{ "type": "error", "error": { "type": "invalid_request_error", "message": "`broute/coding` is a bRoute: it can be the call's `model`, never a fallback.", "code": "invalid_fallback" }}400no_capable_lane没有适合的 bRoute 通道先修正
- 何时出现
- 请求需要某种能力(图像输入、文件、工具、更长的上下文),而这个 bRoute 的所有通道都没有能做到的模型。
- 处理方法
- 在 binference.io 的 bRoute 页面,给某个通道选一个能处理它的模型,或直接调用模型。
- 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "No lane of `broute/coding` can take this request: it needs image input. Give one of its lanes a model that can.", "type": "invalid_request_error", "code": "no_capable_lane", "param": null }}{ "type": "error", "error": { "type": "invalid_request_error", "message": "No lane of `broute/coding` can take this request: it needs image input. Give one of its lanes a model that can.", "code": "no_capable_lane" }}400model_not_served不提供该模型先修正
- 何时出现
:batch版本、已下线的版本,以及调用之后才选定付费模型的自动路由,它们的价格无法提前预留。没有免费版本的模型加上:free,或者:free再加其他变体。还有按请求无法限定上限的内容计费的图像模型,比如字体。- 处理方法
- 使用付费模型本身的 ID,或者在其后加上
:nitro、:floor、:exacto或:online。要用免费模型,从 GET /models 中复制标有free的 ID,或者发送binference/free。 - 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "`anthropic/claude-sonnet-5.5` has no free version here. GET /api/v1/models lists the free models (`free: true`), and `binference/free` picks one for you.", "type": "invalid_request_error", "code": "model_not_served", "param": null }}{ "type": "error", "error": { "type": "invalid_request_error", "message": "`anthropic/claude-sonnet-5.5` has no free version here. GET /api/v1/models lists the free models (`free: true`), and `binference/free` picks one for you.", "code": "model_not_served" }}400tool_not_served不提供该工具先修正
- 何时出现
- 会运行其他模型的工具,或者会在共享账户上保留文件、记忆或沙箱的工具:图像生成工具、托管代码执行、文件搜索、记忆、X 搜索。另外还有没有步数上限的工具循环。
- 处理方法
- 移除该工具,或者在你自己的机器上运行它。联网搜索和网页抓取是支持的。为工具循环设置
max_tool_calls。要生成图像,请调用 POST /images。 - 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "X search bills for every post it returns, with no limit a request can set, so its cost cannot be reserved up front. Remove `x_search` to search the web only.", "type": "invalid_request_error", "code": "tool_not_served", "param": null }}{ "type": "error", "error": { "type": "invalid_request_error", "message": "X search bills for every post it returns, with no limit a request can set, so its cost cannot be reserved up front. Remove `x_search` to search the web only.", "code": "tool_not_served" }}400model_no_image_input模型无法读取图像先修正
- 何时出现
- 请求中带有图像,但模型及其所有备用模型都无法读取图像。
- 处理方法
- 选择一个在 GET /models 中
architecture.input_modalities包含image的模型,或者把这样的模型加为备用模型。 - 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "`z-ai/glm-5.1` does not read images. Send the image to a model that does: GET /api/v1/models lists each model's input modalities.", "type": "invalid_request_error", "code": "model_no_image_input", "param": null }}{ "type": "error", "error": { "type": "invalid_request_error", "message": "`z-ai/glm-5.1` does not read images. Send the image to a model that does: GET /api/v1/models lists each model's input modalities.", "code": "model_no_image_input" }}400image_type_not_served无法读取该图像类型先修正
- 何时出现
- 内联图像(
data:URL 或 base64 块)不是 PNG、JPEG、WebP 或 GIF,比如 HEIC、SVG 或 TIFF。 - 处理方法
- 把图像转换为 PNG、JPEG、WebP 或 GIF,或者以链接形式发送。
- 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "Images are read as PNG, JPEG, WebP or GIF, and this request sends image/heic. Convert it to one of those first.", "type": "invalid_request_error", "code": "image_type_not_served", "param": null }}{ "type": "error", "error": { "type": "invalid_request_error", "message": "Images are read as PNG, JPEG, WebP or GIF, and this request sends image/heic. Convert it to one of those first.", "code": "image_type_not_served" }}413request_too_large请求过大先修正
- 何时出现
- 请求体超过 4 MB,或者提示词超过了模型的上下文长度。
- 处理方法
- 以 URL 发送图像和文件,不要内联 base64:用 POST /uploads 上传大图,再发送它的链接。在 Claude Code 中,运行 /compact 或 /clear。
- 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "The request body is larger than 4 MB. Send images and files as URLs instead of inline data: upload a large image with POST /api/v1/uploads and send its link.", "type": "invalid_request_error", "code": "request_too_large", "param": null }}{ "type": "error", "error": { "type": "request_too_large", "message": "The request body is larger than 4 MB. Send images and files as URLs instead of inline data: upload a large image with POST /api/v1/uploads and send its link.", "code": "request_too_large" }}400request_over_capacity当前输出上限过高先修正
- 何时出现
- 单个请求的预留金额,大于一个 Agent 当前同时最多可预留的金额(网关每日容量的四分之一),或者大于网关能为单次调用保留的金额。如果这些金额是我们这边的限制,消息中会给出具体数值。
- 处理方法
- 调低
max_tokens(Responses 中为max_output_tokens),然后重新发送。 - 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "This request asks for more output than the gateway can take on right now. Lower max_tokens (max_output_tokens on Responses) and retry.", "type": "invalid_request_error", "code": "request_over_capacity", "param": null }}{ "type": "error", "error": { "type": "invalid_request_error", "message": "This request asks for more output than the gateway can take on right now. Lower max_tokens (max_output_tokens on Responses) and retry.", "code": "request_over_capacity" }}404not_found不提供该路径先修正
- 何时出现
- 路径不存在,比如 embeddings 或 Token 计数。
- 处理方法
- 使用本参考文档中的接口之一。
- 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "`POST /v1/embeddings` is not served here. The models are served at /v1/chat/completions, /v1/responses and /v1/messages.", "type": "not_found_error", "code": "not_found", "param": null }}{ "type": "error", "error": { "type": "not_found_error", "message": "`POST /v1/embeddings` is not served here. The models are served at /v1/chat/completions, /v1/responses and /v1/messages.", "code": "not_found" }}402insufficient_balance余额不足先修正
- 何时出现
- Agent 现在可花费的金额,少于本次调用的预留金额,即最坏情况下的费用。消息中会给出这两个金额。上传也需要有一些可花费的额度。
- 处理方法
- 调低
max_tokens让预留金额够用,等待运行中的调用结束,或者充值。Agent 从其代币的交易税中获得额度。 - 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "Balance $0.004210 ($0.001000 held by calls running or being priced) is below this request's reserve of $0.019660. Lower the output limit or add credit.", "type": "billing_error", "code": "insufficient_balance", "param": null }}{ "type": "error", "error": { "type": "billing_error", "message": "Balance $0.004210 ($0.001000 held by calls running or being priced) is below this request's reserve of $0.019660. Lower the output limit or add credit.", "code": "insufficient_balance" }}402key_limit已达到密钥的消费上限先修正
- 何时出现
- 密钥自己的每日、每周或每月上限不足以支付本次调用的预留金额。该 Agent 的其他密钥照常工作。
- 处理方法
- 等到消息中给出的重置时间,调低
max_tokens,或者在 API 密钥页面提高上限。 - 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "This key's limit of $5.000000 a day is used up: $4.990000 spent and $0.000000 held by calls running or being priced, and this request reserves $0.019660. It resets at 2026-10-01T00:00:00.000Z. Lower the output limit, or ask the agent's owner to raise the key's limit.", "type": "billing_error", "code": "key_limit", "param": null }}{ "type": "error", "error": { "type": "billing_error", "message": "This key's limit of $5.000000 a day is used up: $4.990000 spent and $0.000000 held by calls running or being priced, and this request reserves $0.019660. It resets at 2026-10-01T00:00:00.000Z. Lower the output limit, or ask the agent's owner to raise the key's limit.", "code": "key_limit" }}429upload_limit今日上传次数已用完等待后重试
- 何时出现
- 该 Agent 在过去 24 小时内已发起 200 次上传。
- 处理方法
- 按 Retry-After-Ms 中的时间等待,内联发送小图,或者复用已上传图像的链接:它在 24 小时内有效。
- 重试
- 按 Retry-After-Ms 等待后重试
- 费用
- 免费
{ "error": { "message": "This agent started 200 uploads in the last 24 hours, the most it may. Send small images inline, or retry later.", "type": "rate_limit_error", "code": "upload_limit", "param": null }}{ "type": "error", "error": { "type": "rate_limit_error", "message": "This agent started 200 uploads in the last 24 hours, the most it may. Send small images inline, or retry later.", "code": "upload_limit" }}429link_storage_full图像链接已满先修正
- 何时出现
- 该 Agent 以链接形式(
response_format: "url")保存的生成图像中,尚未过期的已达 5 GB。 - 处理方法
- 不传
response_format以获取 base64,或者等待较早的链接过期。 - 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "This agent already holds 5 GB of images as links from the last 7 days. Leave out `response_format` to get base64, or wait for older links to expire.", "type": "rate_limit_error", "code": "link_storage_full", "param": null }}{ "type": "error", "error": { "type": "rate_limit_error", "message": "This agent already holds 5 GB of images as links from the last 7 days. Leave out `response_format` to get base64, or wait for older links to expire.", "code": "link_storage_full" }}429rate_limited速度太快等待后重试
- 何时出现
- 该 Agent 一次发起了超过 60 个调用,或者每分钟超过 600 个。
- 处理方法
- 等待 Retry-After-Ms 后重新发送。官方 OpenAI 和 Anthropic SDK 会自动帮你处理。
- 重试
- 按 Retry-After-Ms 等待后重试
- 费用
- 免费
{ "error": { "message": "This agent is starting calls faster than 600 a minute. Retry in 1 second.", "type": "rate_limit_error", "code": "rate_limited", "param": null }}{ "type": "error", "error": { "type": "rate_limit_error", "message": "This agent is starting calls faster than 600 a minute. Retry in 1 second.", "code": "rate_limited" }}429free_limit已达免费调用限制等待后重试
- 何时出现
- 免费模型的调用超出了限制:每个 Agent 每分钟 5 次、每个 UTC 日 50 次、同时 2 个,或者所有 Agent 共享的全站限制。付费模型不受它影响。
- 处理方法
- 等待 Retry-After 中的时间,或者调用付费模型。错误消息会说明是哪一项限制,以及何时恢复。
- 重试
- 按 Retry-After-Ms 等待后重试
- 费用
- 免费
{ "error": { "message": "This agent used its 50 free calls for today. More at 00:00 UTC, in 5 hours 12 minutes. Paid models are not limited by this.", "type": "rate_limit_error", "code": "free_limit", "param": null }}{ "type": "error", "error": { "type": "rate_limit_error", "message": "This agent used its 50 free calls for today. More at 00:00 UTC, in 5 hours 12 minutes. Paid models are not limited by this.", "code": "free_limit" }}429too_many_running_calls已有 8 个调用在运行等待后重试
- 何时出现
- 该 Agent 有 8 个调用正在运行。任意一个结束,就会立刻空出一个名额。
- 处理方法
- 在你这边对调用排队,或者按响应头给出的时间等待 2 到 8 秒。
- 重试
- 按 Retry-After-Ms 等待后重试
- 费用
- 免费
{ "error": { "message": "This agent already has 8 calls running. Retry when one finishes.", "type": "rate_limit_error", "code": "too_many_running_calls", "param": null }}{ "type": "error", "error": { "type": "rate_limit_error", "message": "This agent already has 8 calls running. Retry when one finishes.", "code": "too_many_running_calls" }}429too_much_reserved已达到预留上限等待后重试
- 何时出现
- 该 Agent 运行中的调用加上这一次,预留金额将超过一个 Agent 同时可预留的上限:网关每日容量的四分之一,这样任何单个 Agent 都无法占用全部容量。调用的预留金额是它最坏情况下的费用,所以输出上限高的调用最快占满。
- 处理方法
- 按响应头给出的时间等待 2 到 8 秒,或者调低
max_tokens,让每次调用预留得更少。 - 重试
- 按 Retry-After-Ms 等待后重试
- 费用
- 免费
{ "error": { "message": "This agent's running calls already reserve $2.000000 of the $2.500000 one agent may reserve at once. Retry when one finishes.", "type": "rate_limit_error", "code": "too_much_reserved", "param": null }}{ "type": "error", "error": { "type": "rate_limit_error", "message": "This agent's running calls already reserve $2.000000 of the $2.500000 one agent may reserve at once. Retry when one finishes.", "code": "too_much_reserved" }}503/529model_busy模型繁忙等待后重试
- 何时出现
- 该模型的所有服务商都已满负荷。在 /messages 上会返回 529
overloaded_error,这样 Claude Code 会切换到它的备用模型。 - 处理方法
- 等待 Retry-After-Ms,或者换一个模型。在
models中列出备用模型,调用就可以在下一个模型上运行。 - 重试
- 按 Retry-After-Ms 等待后重试
- 费用
- 免费
{ "error": { "message": "The model `openai/gpt-6.1` is busy at its providers right now. Retry in 12 seconds.", "type": "server_error", "code": "model_busy", "param": null }}{ "type": "error", "error": { "type": "overloaded_error", "message": "The model `openai/gpt-6.1` is busy at its providers right now. Retry in 12 seconds.", "code": "model_busy" }}503gateway_busy网关繁忙等待后重试
- 何时出现
- 网关暂时达到了容量上限。
- 处理方法
- 等待 Retry-After-Ms 后重新发送。
- 重试
- 按 Retry-After-Ms 等待后重试
- 费用
- 免费
{ "error": { "message": "The gateway is busy right now. Retry in 8 seconds.", "type": "server_error", "code": "gateway_busy", "param": null }}{ "type": "error", "error": { "type": "overloaded_error", "message": "The gateway is busy right now. Retry in 8 seconds.", "code": "gateway_busy" }}503gateway_capacity容量暂时不足等待后重试
- 何时出现
- 网关正在补充容量。bInference 会立即收到警报。
- 处理方法
- 等待 Retry-After-Ms 后重新发送。
- 重试
- 按 Retry-After-Ms 等待后重试
- 费用
- 免费
{ "error": { "message": "The gateway is briefly out of capacity. Try again soon.", "type": "server_error", "code": "gateway_capacity", "param": null }}{ "type": "error", "error": { "type": "overloaded_error", "message": "The gateway is briefly out of capacity. Try again soon.", "code": "gateway_capacity" }}500gateway_error网关出错重试
- 何时出现
- 网关在预留之后出现故障。预留会被释放,本次调用免费。
- 处理方法
- 重新发送。如果一直失败,请带上
x-binference-call-id响应头联系 bInference。 - 重试
- 重试
- 费用
- 免费
{ "error": { "message": "The gateway failed on this call. Retry it.", "type": "server_error", "code": "gateway_error", "param": null }}{ "type": "error", "error": { "type": "api_error", "message": "The gateway failed on this call. Retry it.", "code": "gateway_error" }}504upstream_timeout未在时限内返回重试
- 何时出现
- 模型在时间限制之前什么都没有发送:流式调用 30 分钟,非流式调用 13 分钟。调用仍会运行到结束,并按实际费用扣费。
- 处理方法
- 耗时长的调用请使用流式输出,或者调低
max_tokens,或者换一个更快的模型。 - 重试
- 重试
- 费用
- 只收取服务商记录的费用,通常为零
{ "error": { "message": "The model did not answer in time.", "type": "server_error", "code": "upstream_timeout", "param": null }}{ "type": "error", "error": { "type": "api_error", "message": "The model did not answer in time.", "code": "upstream_timeout" }}502upstream_unreachable无法连接服务商重试
- 何时出现
- 与模型服务商的连接失败。
- 处理方法
- 重新发送。
- 重试
- 重试
- 费用
- 免费
{ "error": { "message": "Could not reach the model provider. Try again.", "type": "server_error", "code": "upstream_unreachable", "param": null }}{ "type": "error", "error": { "type": "api_error", "message": "Could not reach the model provider. Try again.", "code": "upstream_unreachable" }}502provider_error服务商出错重试
- 何时出现
- 模型的服务商出错,或者拒绝了这一次调用。
- 处理方法
- 重新发送,或者换一个模型。
- 重试
- 重试
- 费用
- 只收取服务商记录的费用,通常为零
{ "error": { "message": "The model's provider failed to answer. Try again in a moment.", "type": "server_error", "code": "provider_error", "param": null }}{ "type": "error", "error": { "type": "api_error", "message": "The model's provider failed to answer. Try again in a moment.", "code": "provider_error" }}404no_provider没有服务商能处理此请求先修正
- 何时出现
- 该模型没有任何服务商支持请求中的全部选项,比如工具、图像或长上下文。
- 处理方法
- 去掉某个选项,或者选择一个支持它的模型。
- 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "No provider can serve this request with this model. Try another model, or fewer options such as tools or images.", "type": "not_found_error", "code": "no_provider", "param": null }}{ "type": "error", "error": { "type": "not_found_error", "message": "No provider can serve this request with this model. Try another model, or fewer options such as tools or images.", "code": "no_provider" }}403provider_refused服务商拒绝先修正
- 何时出现
- 服务商自身的政策拒绝了该请求。
- 处理方法
- 修改请求,或者换一个模型。
- 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "The model's provider refused this request for this model.", "type": "permission_error", "code": "provider_refused", "param": null }}{ "type": "error", "error": { "type": "permission_error", "message": "The model's provider refused this request for this model.", "code": "provider_refused" }}422unprocessable服务商无法处理先修正
- 何时出现
- 服务商接受了请求,但无法执行。
- 处理方法
- 对照模型检查参数,或者换一个模型。
- 重试
- 先修正
- 费用
- 免费
{ "error": { "message": "The model's provider could not process this request.", "type": "server_error", "code": "unprocessable", "param": null }}{ "type": "error", "error": { "type": "api_error", "message": "The model's provider could not process this request.", "code": "unprocessable" }}408timeout服务商超时重试
- 何时出现
- 服务商放弃了这次调用(408 或 504)。
- 处理方法
- 重新发送、使用流式输出,或者调低
max_tokens。 - 重试
- 重试
- 费用
- 只收取服务商记录的费用,通常为零
{ "error": { "message": "The model took too long to answer. Try again.", "type": "server_error", "code": "timeout", "param": null }}{ "type": "error", "error": { "type": "api_error", "message": "The model took too long to answer. Try again.", "code": "timeout" }}502upstream_error其他服务商错误重试
- 何时出现
- 来自服务商的其他任何错误。
- 处理方法
- 稍后重新发送。
- 重试
- 重试
- 费用
- 只收取服务商记录的费用,通常为零
{ "error": { "message": "The request could not be completed. Try again in a moment.", "type": "server_error", "code": "upstream_error", "param": null }}{ "type": "error", "error": { "type": "api_error", "message": "The request could not be completed. Try again in a moment.", "code": "upstream_error" }}速览
| 状态码 | 含义 | 重试? |
|---|---|---|
400 | 请求无法按原样处理 | 否。先修正 |
401 | 密钥缺失、错误或已撤销 | 否 |
402 | 余额或密钥的上限不足以支付预留金额 | 否。调低 max_tokens 或充值 |
403 | Agent 尚未启用 | 否 |
404 | 路径不存在,或者没有服务商能处理此请求 | 否 |
413 | 请求体超过 4 MB | 否。以 URL 发送文件 |
429 | 运行中的调用太多,或者速度太快 | 是,等待 Retry-After-Ms 之后 |
500 | 网关出错。本次调用免费 | 是 |
502 504 | 模型的服务商出错 | 是 |
503 529 | 暂时繁忙 | 是,等待 Retry-After-Ms 之后 |
流式输出中的错误
回答一旦开始流式输出,错误就无法再改变状态码。它会以该格式自己的错误事件到达,这样 SDK 会抛出错误,而不是一直挂起:
data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"error"}],"error":{"message":"The model took too long to answer. Try again.","type":"server_error","code":"timeout"}}调用会按出错前已生成的内容扣费。