4xx Client Errors
400 Bad Request
The request body is malformed or contains invalid parameters.- Missing required fields (
model,messages) - Invalid JSON syntax
- Unsupported parameters for the target provider
401 Unauthorized
The API key is missing, invalid, or has been revoked.- Missing
Authorizationheader - API key doesn’t start with
sk-metrix- - API key has been deleted or deactivated
- Key hash doesn’t match any active key in the database
402 Payment Required
The workspace has insufficient credits or has exceeded its budget cap.- Monthly budget cap reached
- Prepaid credit balance depleted
- Workspace billing overdue
403 Forbidden
The request is blocked by workspace security policies.404 Not Found
The requested resource doesn’t exist.- Requested endpoint doesn’t exist (e.g.
/v1/unknown-endpoint) - Batch ID not found in
/v1/batches/:id/results
413 Payload Too Large
The request body exceeds the gateway’s 2MB limit.429 Too Many Requests
A rate limit has been exceeded.5xx Server Errors
500 Internal Server Error
An unexpected error occurred within the gateway.502 Bad Gateway
The upstream LLM provider returned an invalid response or is unreachable.- Provider API returned non-JSON response
- Network timeout connecting to provider
- Provider returned an unexpected response format
503 Service Unavailable
All providers in the fallback chain are down or the circuit breaker is open.Provider-Specific Errors
When a provider returns an error, the gateway forwards it with the original status code:OpenAI errors
Anthropic errors
Google Gemini errors
Batch API Errors
Circuit Breaker Errors
When a provider experiences repeated failures, the gateway’s circuit breaker activates:
The circuit breaker opens after 5 consecutive failures and closes after 3 successful requests.