/Docs
Back to dashboard

Errors

Claude API error codes and troubleshooting — 401, 429, 500 status codes. How to handle rate limits and authentication errors.

LLMsRelay is an independently operated API gateway. It is not affiliated with or endorsed by Anthropic, PBC. Product and model names are used only to describe compatibility.

401: Invalid or missing sk-cs4-* key. 402: Out of credits — top up to continue. 429: Rate limited — back off using Retry-After. 500/502/504: Transient — retry with exponential backoff.

Anthropic Error Format

Anthropic-style errorjson
{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "model: Invalid model ID"
  }
}

OpenAI Error Format

OpenAI-style errorjson
{
  "error": {
    "message": "Invalid model ID",
    "type": "invalid_request_error",
    "code": "invalid_model"
  }
}

HTTP Status Codes

StatusMeaningAction
400Bad Request — invalid parametersCheck request body and parameters
401Unauthorized — invalid or missing API keyVerify your API key
403Forbidden — insufficient permissionsCheck key permissions and credit balance
429Rate Limited — too many requestsReduce request rate, implement backoff
500Internal Server ErrorRetry with exponential backoff
502Bad Gateway — upstream errorRetry after a brief delay
529Overloaded — service at capacityRetry with exponential backoff

Debugging Tips

  • Always check the error.type and error.message fields for specific information
  • For 429 errors, implement exponential backoff starting at 1 second
  • For 5xx errors, retry up to 3 times with increasing delays
  • Use GET /health to check service status
  • Verify model IDs match exactly (e.g., claude-sonnet-4.6)

Ready to start?

Create a key and configure a compatible API route in under 2 minutes.

View Plans