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 -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
| Symptom | Check | Next step |
|---|---|---|
| 400 / invalid request | Required fields, JSON structure, model parameters, context length | Remove optional parameters and reduce the prompt. |
| 401 / unauthorized | Missing, expired, disabled, or incorrect key | Verify the authentication header and reload the application environment. |
| 403 / forbidden | Account, key, group, model, or access restrictions | Review API key settings and the model's access requirements. |
| 404 / model not found | Exact model ID, endpoint path, duplicated /v1, protocol support | Copy an accessible ID and use the matching protocol guide. |
| 429 / rate limit | Request or token limits; inspect the error body | Reduce concurrency and use bounded exponential backoff with jitter. |
| Insufficient credits or quota | Wallet, subscription quota, key quota, billing preference | Check Wallet and key limits; do not repeatedly retry a funding failure. |
| 5xx / upstream unavailable | Temporary gateway or provider failure | Use bounded retries when safe; switch to a supported alternative if appropriate. |
| Timeout / incomplete stream | Client timeout, proxy buffering, network interruption | Test 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.