Skip to content

Common Error Codes ​

Possible error codes and their solutions when calling the API:

HTTP Status Codes ​

Error CodeDescriptionSolution
400Bad request formatCheck whether the request parameters are correct
401Authentication failedCheck whether the API Key is correct
403Insufficient permission or insufficient balanceCheck account balance or token permissions
404Interface does not existCheck whether the requested URL is correct
429Too many requestsReduce request frequency and try again later
500Internal server errorTry again later; if it persists, contact customer service
502Gateway errorUpstream service exception, try again later
503Service unavailableService may be under maintenance, try again later

Business Error Codes ​

Insufficient Quota ​

json
{
  "error": {
    "message": "user quota is not enough",
    "type": "insufficient_quota"
  }
}

Solution: Please go to the wallet page to recharge.

Invalid Token ​

json
{
  "error": {
    "message": "invalid token",
    "type": "invalid_request_error"
  }
}

Solution: Check whether the API Key is correct; make sure the token has not been deleted.

No Available Channel ​

json
{
  "error": {
    "message": "No available channel under the current group",
    "type": "channel_error"
  }
}

Solution: Check whether the model name is correct; note case sensitivity.

Request Parameter Error ​

json
{
  "error": {
    "message": "max_tokens is too large",
    "type": "invalid_request_error"
  }
}

Solution: Lower the max_tokens value and ensure that the context token count plus max_tokens does not exceed the model limit.