Errors & troubleshooting

Errors & troubleshooting

Read both the HTTP status and response body. The same status can have different causes across upstream providers, so diagnose the message before repeating a request.

Start with a minimal check

cURL
curl -sS -w "\nHTTP %{http_code}\n" https://api.livrouter.com/v1/models \  -H "Authorization: Bearer $OPENAI_API_KEY"

Then send the smallest generation request from Quickstart. If model discovery works but generation fails, check funds, group access, the model ID, and the selected protocol.

Common errors

SymptomCheckNext step
400 / invalid requestRequired fields, JSON structure, model parameters, context lengthRemove optional parameters and reduce the prompt.
401 / unauthorizedMissing, expired, disabled, or incorrect keyVerify the authentication header and reload the application environment.
403 / forbiddenAccount, key, group, model, or access restrictionsReview API key settings and the model's access requirements.
404 / model not foundExact model ID, endpoint path, duplicated /v1, protocol supportCopy an accessible ID and use the matching protocol guide.
429 / rate limitRequest or token limits; inspect the error bodyReduce concurrency and use bounded exponential backoff with jitter.
Insufficient credits or quotaWallet, subscription quota, key quota, billing preferenceCheck Wallet and key limits; do not repeatedly retry a funding failure.
5xx / upstream unavailableTemporary gateway or provider failureUse bounded retries when safe; switch to a supported alternative if appropriate.
Timeout / incomplete streamClient timeout, proxy buffering, network interruptionTest a short response and inspect the stream's final event and error.

Retry safely

Retry temporary failures with a maximum attempt count and increasing delays. Respect Retry-After when provided. Do not automatically retry invalid credentials, unsupported models, or exhausted funds. A lost connection can happen after work began, so a repeated request may incur another charge.

Check client configuration

  • OpenAI-compatible clients use https://api.livrouter.com/v1; Anthropic SDK clients omit /v1.
  • Restart the client after changing environment variables or provider settings.
  • Confirm the selected model belongs to the custom provider you configured.
  • Use the correct stream parser: Chat Completions, Messages, and Responses events differ.

Contact support

Send the timestamp and timezone, model ID, client version, HTTP status, sanitized error body, and request ID if one was returned to [email protected]. Include a relevant usage or order reference when available. Remove API keys, authorization headers, personal data, and confidential prompt content.