TokenHub uses standard HTTP status codes to indicate the outcome of every request. Errors always return a JSON body so your application can parse the failure reason programmatically and react accordingly.Documentation Index
Fetch the complete documentation index at: https://docs.inferoute.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Error response format
All error responses share this structure:| Field | Type | Description |
|---|---|---|
type | string | Broad error category |
message | string | Human-readable description of the error |
code | string | Machine-readable error code for programmatic handling |
Error codes
| Status | Type | When it occurs |
|---|---|---|
400 Bad Request | invalid_request_error | Malformed JSON body or missing required fields |
401 Unauthorized | authentication_error | Missing or invalid API key |
402 Payment Required | usage_limit_exceeded | Monthly usage limit has been reached |
404 Not Found | not_found_error | Model not found or endpoint path is invalid |
422 Unprocessable Entity | invalid_request_error | Valid JSON but parameter values fail validation (e.g., temperature out of range) |
429 Too Many Requests | rate_limit_error | Request rate limit exceeded |
500 Internal Server Error | api_error | Internal TokenHub error or unexpected provider failure |
503 Service Unavailable | provider_error | All configured providers (including fallbacks) are unavailable |
Retry logic
Not all errors are worth retrying. Use this guidance to decide: Retry these errors — they are transient and typically resolve automatically:429 Too Many Requests— back off and retry after the interval in theRetry-Afterheader500 Internal Server Error— retry with exponential backoff503 Service Unavailable— retry with exponential backoff; consider adding fallback models viaX-Inferoute-Fallback
400 Bad Request— fix the request body before retrying401 Unauthorized— provide a valid API key402 Payment Required— upgrade your plan or wait for the billing period to reset404 Not Found— check the model ID and endpoint path422 Unprocessable Entity— correct the invalid parameter values