Skip to content

Errors

Consus Gateway returns errors in the OpenAI error format so existing SDK error handling works without changes.

Error Response Format

{
  "error": {
    "message": "Description of what went wrong",
    "type": "error_type"
  }
}

Error Types

HTTP Status Error Type Meaning
400 invalid_request_error Bad request — invalid model, missing fields, or validation failure
403 permission_error Invalid or missing API key, or access denied to the requested model
429 rate_limit_error Rate limit or monthly quota exceeded
500 server_error Internal server error
502 server_error Upstream provider error (Bedrock unavailable or returned a server error)

Retries

Consus Gateway automatically retries transient upstream errors (5xx from Bedrock, connection failures) once with a 0.5s delay before returning an error to you.

For client-side retries, the OpenAI SDK has built-in retry logic that works out of the box. If you're using raw HTTP, retry on 429 and 502 with exponential backoff.

Common Errors

Invalid model:

{
  "error": {
    "message": "Model 'gpt-4' is not available. Use /v1/models to see available models.",
    "type": "invalid_request_error"
  }
}

Rate limited (API Gateway):

HTTP 429 Too Many Requests

Bedrock throttling:

{
  "error": {
    "message": "ThrottlingException: Rate exceeded",
    "type": "rate_limit_error"
  }
}