Get startedAPI referenceGoing to productionExplore models

Account & operations

Errors

OpenAI-compatible endpoints return an OpenAI error envelope. The Messages endpoint returns an Anthropic-compatible error envelope. Use the HTTP status and machine-readable code or type for handling.

400Invalid request
401Invalid API key
402Insufficient credit
429Rate limit
502Provider failure
504Request timeout
OpenAI-compatible error
{
  "error": {
    "message": "Model 'unknown' was not found.",
    "type": "invalid_request_error",
    "param": "model",
    "code": "model_not_found"
  }
}
Copied