error field containing details about what went wrong.
Error Response Format
object
required
HTTP Status Code Summary
Below is a summary of the HTTP status codes that Edgee API uses.Error Codes
400 Bad Request
string
One of the following error codes:
bad_model_id: The model ID format is invalidmodel_not_found: The requested model does not exist or is not availableprovider_not_supported: The requested provider is not supported for the specified modelstreaming_not_supported: Streaming is only supported when using Anthropic provider for Messages API
401 Unauthorized
string
Always
"unauthorized".403 Forbidden
string
Always
"forbidden".429 Too Many Requests
string
Always
"usage_limit_exceeded".500 Internal Server Error
When a server error occurs, the API may return a generic error response. These errors are rare and typically indicate an issue on Edgee’s side.Handling Errors
When you receive an error response:- Check the HTTP status code to understand the general category of the error
- Read the error code (
error.code) to understand the specific issue - Review the error message (
error.message) for additional context - Take appropriate action:
- 400 errors: Fix the request parameters and retry
- 401 errors: Check your API key and authentication headers
- 403 errors: Verify your API key permissions and status
- 429 errors: Read the error message. For a spend limit, wait for its reset or ask an administrator to change the limit; retrying does not restore the budget. For a provider rate limit, reduce traffic and retry with backoff.
- 5xx errors: Retry after a delay, or contact support if the issue persists
Budget exhaustion versus rate limiting
A key, member, squad, or routing budget can stop requests with a 429. Check usage limits and the active routing strategy. Repeated retries cannot replenish a budget. An all-time limit does not reset automatically.Rate Limiting
If you exceed the rate limits, you will receive a429 Too Many Requests response. We recommend implementing exponential backoff when you encounter rate limit errors:
- Wait for the time specified in the
Retry-Afterheader (if present) - Retry the request with exponential backoff
- Reduce the rate of requests to stay within limits