Troubleshoot API requests

Check credentials, model access, limits, URLs, and interrupted requests.

Troubleshooting

For support, include the time, model, request ID if supplied, and error status. Never send your API key, session cookie, or password. Error details vary by endpoint; use the returned status and message rather than assuming one universal error shape.

  1. Authentication failed: copy the complete key again, remove extra whitespace, and check its active status and expiry. Custom keys do not necessarily begin with sk-.
  2. Model unavailable or access denied: verify the selected key’s group and available model list. Check IP restrictions and provider route availability.
  3. Quota or balance exhausted: inspect the key’s quota and rolling USD limits, then the account balance or subscription usage. Changing a key quota does not fund the account.
  4. Request URL not found: use /v1 as the SDK base URL, and /v1/chat/completions for a direct Chat Completions request. Use the protocol supported by your chosen model.
  5. Rate-limited or temporarily unavailable: wait before trying again and check service status. Avoid repeatedly resending a request that may already have been processed.
  6. Stream stopped: keep the partial answer and check Usage. Start another request only when you want to retry.
  7. Playground with an IP-restricted key: the gateway sees the console server’s connection. A key that works from your application may not permit that connection. Keep the restriction unless you intend to change it.

Verify the answer and billed usage

  1. Check the returned assistant message. An error response is not a successful answer.
  2. Open Usage and select a date range that includes the request. Check the displayed timezone.
  3. Find the request by its model and key name. Review input/output and cache tokens, latency, and actual billed cost.
  4. If a request is interrupted or times out, check Usage before repeating it. A retry is a separate request and can incur another charge.