AI API calls return 429 error or Token quota exceeded.
When calling the TCB AI large model, you may encounter 429 Too Many Requests or EXCEED_TOKEN_QUOTA_LIMIT errors. This article introduces common causes and solutions.
Problem Symptoms
When calling the AI large model API, one of the following errors is returned:
- HTTP 429 Too Many Requests
- Error code EXCEED_TOKEN_QUOTA_LIMIT: indicating Token usage exceeded quota limit
{
"code": "EXCEED_TOKEN_QUOTA_LIMIT",
"message": "Token usage exceeded quota limit."
}
Common Causes
Cause 1: Token quota exhausted
The free quota for different models is calculated independently:
| Source of Free Quota | Applicable Scope |
|---|---|
| AI Mini Program Growth Plan (100 million Token) | Limited to Hunyuan series models |
| 1 million Token gifted with CloudBase environment | DeepSeek series models, Hunyuan series models |
Note: When calling the DeepSeek model, if the environment-gifted Token is exhausted, you cannot use the Token gifted by the AI Mini Program Growth Plan.
Cause 2: Concurrent requests exceeded the limit
The TCB AI+ interface has a default concurrency limit (default: 5). Frequent calls within a short period may trigger the limit.
Cause 3: The call source does not meet the requirements
The Token gifted by the AI Mini Program Growth Plan is limited to the following call sources:
- Call from the Mini Program client
- Calls with administrator identity (including console experience, calls in cloud functions, etc.)
Solution
Solution 1: Check Token usage
- Log in to the TCB console
- Go to the AI module
- View each model's Token usage
Solution 2: Increase the concurrency quota
If a 429 error is caused by concurrency exceeding the limit, you can:
- Submit a ticket to apply for an increase of the concurrency quota
- Provide your environment ID in a community Issue to apply for an increase
Solution 3: Switch models
If the quota for the currently used model has been exhausted, you can consider switching to other models (e.g., from DeepSeek to the Hunyuan series).
Solution 4: Configure a custom model
You can configure your own large model API Key for use. For details, refer to: Large Model Configuration Guide
Similar Issues
- How to resolve AI API calls returning 429 Too Many Requests?
- What does the EXCEED_TOKEN_QUOTA_LIMIT error mean?
- What is the free quota for the DeepSeek model?
- Can the Token quota for Hunyuan models be used for DeepSeek?
- What is the default concurrency limit for TCB AI?
- How to increase the concurrency quota for AI calls?
- Which models is the Token gifted by the AI Mini Program Growth Plan applicable to?
- How to view AI Token usage?
- How to continue using the AI feature after the Token quota is used up?
- How to address frequent errors in TCB AI calls?