Skip to content

Errors and Debugging

RouteAPI tries to return a unified error structure so clients can identify the error source and handling method.

{
"error": {
"message": "Invalid API key",
"type": "authentication_error",
"code": "invalid_api_key"
}
}
Status codeTypeCommon causeSuggested handling
400Request errorBad parameter format or unsupported model parameterCheck request body and model capability
401Authentication errorMissing, wrong, or deleted TokenCheck Authorization
402Balance errorInsufficient user balance or exhausted Token quotaRecharge or adjust quota
404Path errorEndpoint does not existCheck URL
429Rate limitUser, Token, or system rate limitReduce concurrency or adjust rate limit
500System errorRouteAPI internal errorCheck service logs
  1. Confirm request URL, Token, and model ID.
  2. Confirm the Token owner balance, quota, and access permissions.
  3. Check console usage logs to confirm whether the request entered RouteAPI.
  4. For streaming requests, confirm the client handles SSE correctly.

RouteAPI is a gateway system. Errors may come from three layers:

LayerExample
ClientRequest body JSON error, missing Token
RouteAPIInsufficient balance, no permission
Model serviceService rate limit, service unavailable, model offline

For production troubleshooting, record these fields together:

  • Request time
  • Token or user ID
  • Model ID
  • HTTP status code
  • Error code returned by RouteAPI
  • Error information in console usage logs