Skip to content

Error Handling

In case of an error, the API returns a response in standard JSON format with an appropriate HTTP status (4xx or 5xx).

Error Format

json
{
  "error": {
    "code": "insufficient_balance",
    "message": "Not enough funds on balance to perform the request.",
    "type": "billing_error"
  }
}

Standard Error Codes

Error CodeDescription
authentication_requiredMissing Authorization header
invalid_api_keyInvalid or revoked API key
insufficient_balanceNegative balance (for paid models)
api_key_limit_exceededSpending limit exceeded for this key
model_unavailableRequested model is disabled or not found
router_unavailableNo available nodes to process request (upstream)
validation_failedJSON request body validation error
rate_limitedToo many requests
internal_errorInternal platform error

Upstream Errors

If an error occurred on the model provider's side (e.g., OpenAI or Anthropic) after the gateway successfully routed the request, OpenRussiaRouter proxies this error back to the client in its original form.