API Reference

Error Codes

Complete reference for every error code the OneRouter API can return, with descriptions and troubleshooting steps.

HTTP Status Codes

CodeMeaningAction
200SuccessRequest completed normally
400Bad RequestCheck your request body for malformed JSON or missing required fields
401UnauthorizedVerify your API key is correct and active in the dashboard
402Payment RequiredInsufficient balance — top up in the billing dashboard
404Model Not FoundCheck the model ID — see available models
429Rate LimitedImplement exponential backoff — see rate limits
500Internal ErrorOneRouter-side issue — retry with backoff or contact support
502Bad GatewayUpstream provider error — auto-failover may activate
503Service UnavailableTemporary overload — retry after the Retry-After header value

Error Response Format

json
{
  "error": {
    "message": "Invalid API key",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}