Skip to content

Troubleshooting

Quickly diagnose protocol, key, model, and environment errors.

Find the category, then the row that matches what you see. The full status-code table, retry rules, and what to include in a report are in Error codes and retries.

The gateway returns Simplified Chinese, Traditional Chinese, English, Japanese, or Spanish text based on the Accept-Language header, and English when the header is not set. The tables quote the English text.

Keys, balance, and permissions

SymptomCauseWhat to do
401 "Missing API key"
"Invalid API key"
"API key has expired"
No key sent, copied incompletely or with extra spaces, or deleted, disabled, or expiredRe-copy the full key from API Keys in the console; create a new one if needed
402 "Insufficient balance"
"API key quota exhausted"
"Member quota exhausted"
"Department quota exhausted"
Account balance, key quota, or enterprise member or department quota is insufficientAdd funds or adjust the quota first; 402 does not resolve on its own, so do not retry in a loop
A video submission returns 402 "Insufficient balance: available …"Not enough balance to reserve when the video task was submittedAdd funds, then resubmit; do not retry in a loop
403 "This account has been disabled"
"This member account has been disabled"
"This member is not allowed to use the group bound to this API key"
"API key is not bound to any group, please contact the administrator"
"Image generation is not enabled for the current group"
Account, member, or group settingsContact your administrator; do not retry
404 "The group this API key belongs to has been taken offline and no longer serves requests…"The key's group has been discontinuedCreate a new key in a currently sold group and replace the old one

Models and paths

SymptomCauseWhat to do
404 "The current group does not support the requested model: X"
"The group this API key belongs to does not provide the requested model…"
The ID is not in any of this key's groups, is misspelled, or is a decommissioned ID left in your client configCopy a full ID from GET /v1/models with this key; if it is missing, add the model's group to the key. Do not retry automatically
404 "This API path is not supported by the current platform"A Claude key called an OpenAI-protocol endpointSwitch Claude to the Anthropic protocol
Same as aboveThe Anthropic Base URL has an extra /v1 (/v1/v1/messages)Leave /v1 out of the Base URL
Same as aboveThe path is not exposed, such as /v1/dashboard/billing/*, /v1/files, /v1/batches, /v1/embeddingsCheck balance with GET /v1/usage or the console
Same as aboveCodex web search called /v1/alpha/searchThis 404 does not affect conversations
A video endpoint returns 404 "This API path is not supported by the current platform"The video path is wrongPer the Video API, submit with POST /v1/video/generate and poll GET /v1/video/tasks/{task_id}

Request content

SymptomCauseWhat to do
400 "Failed to read request body"
"Request body must be a JSON object with valid field types"
"Missing required field: model"
"messages must be a non-empty array"
The body is incomplete or has invalid fieldsCheck the JSON and Content-Type
413 "Request body exceeds the size limit (60 MB)"The body exceeds 60 MB, usually base64 images or videoCompress large files, or pass a URL when the model supports it
400 for exceeding context length (text varies by model)History, attachments, and max_tokens together exceed the context windowTrim the history or start a new conversation, and reduce max_tokens
400 "Invalid signature in thinking block"
"duplicate thinking.signature"
Claude's thinking history was rewritten, spliced, or duplicatedResend the last thinking block unchanged, with its signature; never merge it or reuse it across models. Else restart without thinking history
400 "No tool call found for function call output"
"No tool output found for function call"
Tool results and calls are not paired: tool_call_id / call_id mismatch, or one side is missingReturn one result per tool call with its ID unchanged; trim history in pairs
400 "Unsupported parameter: …"The model does not accept a parameter you sentRemove it; on the Responses API, use max_output_tokens, not max_tokens

Images and video

SymptomCauseWhat to do
400 content rejected by a safety policy (for example "Your request was rejected by the safety system.")The prompt or a reference asset triggered the content-safety policyRevise the prompt or asset; resending unchanged is rejected again
400 invalid image parameters (for example "size … is not valid")The size, tier, or count is outside what that model supportsAdjust the value for that model per the Image API
400 "media_download_failed"A reference image or video URL is not publicly reachableUse an HTTP(S) URL that downloads without signing in
400 "InputImageSensitiveContentDetected.PrivacyInformation"Seedance 2.0 runs privacy detection on real-person references passed directlyUpload with POST /v1/sd/assets first, then reference asset://asset-id; see the Video API
An async task poll returns status: "failed" (for example "the prompt was rejected by content moderation; rephrase it and submit again")The reason is in error.message, with no code; not billedFix what the message says, then resubmit; see Error codes and retries
You need the actual charge for an async taskReturned in the task query once the task finishesRead top-level usage.cost_usd (the USD amount deducted from your balance), usage.cost (the same charge in CNY), and usage.currency (0 for an uncharged failure); finished tasks in a task list carry them too. See the Video API

Rate limits, timeouts, and disconnects

SymptomCauseWhat to do
429 "User concurrency limit reached, please retry later"
"API key concurrency limit reached, please retry later"
In-flight requests exceed the account's or key's concurrency limitQueue on the client and retry after Retry-After; limits are in Concurrency, timeouts, and billing
429 "… are currently rate limited, please retry later"
502 "… service is temporarily unavailable, please retry later"
503 "No … is available right now, please retry later"
503 "The request could not be completed right now, please retry later"
504 "… request timed out, please retry later"
503 "Authentication service is temporarily unavailable, please retry"
The service is temporarily unavailable or timed outRetry with Retry-After or exponential backoff, or switch models in the same family. Past 10 minutes, contact us with the X-Request-ID header
503 "This conversation is tied to a stateful session that can no longer be resumed…"The original session is goneStart a new conversation without previous_response_id
The request disconnects mid-flight and is logged as 499The client disconnected first: a manual cancel, or its read timeout fired (openai-python defaults to 600 seconds)Use streaming for long outputs and raise the client's read timeout
A stream gets an error event partway (for example "Response stream interrupted, please retry") or dropsThe failure came after output started, so the stream cannot resumeDiscard the partial output and resend the whole request

Local environment

SymptomCauseWhat to do
"node / npm is not recognized"Node.js is missing or not on PATHReinstall from nodejs.org (keep Windows defaults), then reopen the terminal
PowerShell blocks script executionWindows execution-policy restrictionsPrefer the console's one-click setup command, or run Set-ExecutionPolicy RemoteSigned as Administrator

Still stuck after working through these tables? Contact us with the client name, model ID, approximate time, HTTP status code, the X-Request-ID from the response headers, and a screenshot with the key hidden.

Next steps