Error Codes

HTTP status codes, error response format, and handling guidance.

Error response format

All errors return a JSON body following the OpenAI error schema:

{
  "error": {
    "message": "Insufficient credit balance",
    "type": "insufficient_funds",
    "code": "balance_exceeded"
  }
}

Status codes

StatusMeaningWhat to do
400Bad requestCheck your request body for malformed JSON or missing fields.
401UnauthorizedVerify your API key is correct and starts with tr-.
402Insufficient balanceAdd credits or enable auto-recharge in your API Dashboard.
404Model not foundCheck the model ID against available models.
429Rate limitedWait for Retry-After seconds before retrying.
500Internal server errorRetry after a brief delay. Contact support if persistent.
502Provider errorRetry — the router will try an alternative provider if available.