Errors, limits, and retries

Resolve client installation, configuration, status-code, and retry issues in one place.

Installation

  • Command not found after installation: close and reopen the terminal, then confirm that the npm global executable directory is on PATH.
  • Client surfaces differ: OpenCode CLI, desktop, and local Web use the same configuration; Kimi Web is provided by the CLI.
  • A VS Code extension does not read its configuration: confirm that the official extension is installed, save the file, and fully quit and reopen VS Code.

Configuration and protocols

Use the relevant client guide as the source for the Base URL, API Key, and model name.

  • Codex uses OpenAI Responses. Its Base URL ends in /v1 and wire_api is responses.
  • Claude uses Anthropic Messages. Its Base URL does not include /v1; the client requests /v1/messages.
  • Other OpenAI Compatible clients use the address ending in /v1.
  • Write the Key directly to the corresponding client configuration or settings UI. Remove conflicting old Keys, environment variables, or providers.

Client limitations

  • Cursor requires Cursor Pro for a custom API Key, Base URL, and named model. Cursor Free and Auto cannot configure or verify a custom route.
  • CCSwitch writes and switches providers; it is not an agent. Confirm the final reply in Codex or Claude.
  • Menu labels can vary across GUI-client versions. Use the model, provider, or API Key settings page, not the account sign-in page.

HTTP status

StatusCommon causeAction
400Invalid body, conflicting fields, or protocol mismatchFix the configuration or request; do not replay unchanged
401Missing, malformed, or unread API KeySave the Key again and restart the client
402Insufficient usable balanceReview balance and recharge
403Invalid Key, account policy, CIDR, spend, or API URL restrictionCheck the Key, account policy, and address
404Wrong Base URL suffix, operation path, or model nameCorrect the address for the protocol and verify the public model
405Unsupported protocol or operationSelect an operation supported by the client and route
413Request body or file exceeds a limitReduce the input or file
429RPM, concurrency, or account-capacity limitWait and use bounded backoff
502 / 503 / 504Service temporarily unavailable or response timed outWait briefly and retry

Retry deliberately

After a timeout or disconnect, the original call may still have completed. Before retrying:

  1. Confirm the status of the original request.
  2. Decide whether duplicate output and charges are acceptable.
  3. Apply bounded backoff only for 429 and temporary dependency failures.
  4. Treat the retry as a new independent call.

On this page