API Reference
Error Codes
Complete reference for every error code the OneRouter API can return, with descriptions and troubleshooting steps.
HTTP Status Codes
| Code | Meaning | Action |
|---|---|---|
| 200 | Success | Request completed normally |
| 400 | Bad Request | Check your request body for malformed JSON or missing required fields |
| 401 | Unauthorized | Verify your API key is correct and active in the dashboard |
| 402 | Payment Required | Insufficient balance — top up in the billing dashboard |
| 404 | Model Not Found | Check the model ID — see available models |
| 429 | Rate Limited | Implement exponential backoff — see rate limits |
| 500 | Internal Error | OneRouter-side issue — retry with backoff or contact support |
| 502 | Bad Gateway | Upstream provider error — auto-failover may activate |
| 503 | Service Unavailable | Temporary overload — retry after the Retry-After header value |
Error Response Format
json
{
"error": {
"message": "Invalid API key",
"type": "authentication_error",
"code": "invalid_api_key"
}
}