Common Error Codes
Possible error codes and their solutions when calling the API:
HTTP Status Codes
| Error Code | Description | Solution |
|---|---|---|
| 400 | Bad request format | Check whether the request parameters are correct |
| 401 | Authentication failed | Check whether the API Key is correct |
| 403 | Insufficient permission or insufficient balance | Check account balance or token permissions |
| 404 | Interface does not exist | Check whether the requested URL is correct |
| 429 | Too many requests | Reduce request frequency and try again later |
| 500 | Internal server error | Try again later; if it persists, contact customer service |
| 502 | Gateway error | Upstream service exception, try again later |
| 503 | Service unavailable | Service 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.