Skip to main content

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:

  1. HTTP 429 Too Many Requests
  2. 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 QuotaApplicable Scope
AI Mini Program Growth Plan (100 million Token)Limited to Hunyuan series models
1 million Token gifted with CloudBase environmentDeepSeek 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

  1. Log in to the TCB console
  2. Go to the AI module
  3. 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:

  1. Submit a ticket to apply for an increase of the concurrency quota
  2. 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

  1. How to resolve AI API calls returning 429 Too Many Requests?
  2. What does the EXCEED_TOKEN_QUOTA_LIMIT error mean?
  3. What is the free quota for the DeepSeek model?
  4. Can the Token quota for Hunyuan models be used for DeepSeek?
  5. What is the default concurrency limit for TCB AI?
  6. How to increase the concurrency quota for AI calls?
  7. Which models is the Token gifted by the AI Mini Program Growth Plan applicable to?
  8. How to view AI Token usage?
  9. How to continue using the AI feature after the Token quota is used up?
  10. How to address frequent errors in TCB AI calls?