XRToken API Docs

Error Codes

HTTP status codes and error handling

API Configuration
After saving, the Try It panel below sends real requests with this key.
Base: api.xrtoken.ai

Error Response Format

All errors return a consistent JSON format:

{
  "error": {
    "message": "Error description",
    "type": "error_type"
  }
}

Status Codes

HTTP StatusMeaningRecommended Action
400Bad RequestCheck required fields like model, messages
401UnauthorizedVerify API Key is correct and not revoked
402Insufficient BalanceTop up your account
429Rate LimitedReduce request frequency; current limit is 60 RPM
502Upstream ErrorProvider temporarily unavailable; retry later
503Service UnavailableSystem maintenance; retry later

Retry Guidelines

  • 429 -- Use exponential backoff, max interval 60 seconds
  • 502 / 503 -- Wait 5-10 seconds before retrying, max 3 retries
  • 400 / 401 / 402 -- Do not retry; fix request params or account status

On this page