How to handle Tripo API 429 rate limit errors?
If you encounter 429 Too Many Requests, code: 1007, or code: 2000 errors when calling the Tripo API, it typically means your request frequency or the number of concurrently running tasks has exceeded the limits of your current API Key or account. This guide will help you understand Tripo API rate limits and concurrency limits, and explain how to avoid these errors in real-world applications.
Why Are There Rate and Concurrency Limits?
Tripo API uses rate limits and concurrency limits to ensure service stability and fair access to GPU computing resources across different users. Note that rate limits and concurrency limits are two distinct concepts:
- Rate Limit: Restricts the number of API requests that can be made within a given time window. This limit is calculated per API Key, and differs across API endpoints. Generation endpoints have relatively lower limits, while task query endpoints have relatively higher limits.
- Concurrency Limit: Restricts the number of tasks running simultaneously under an account. This limit is calculated per account, with separate concurrency pools set for different task categories. For specific concurrency pool rules, refer to Tripo API Rate Limits.
What Does a 429 Error Mean?
When the request frequency exceeds the rate limit, the Tripo API returns HTTP 429 Too Many Requests with error code 1007.
When the number of concurrent tasks for a task category reaches its maximum, the API also returns HTTP 429, but with error code 2000.
How to Handle 429 Errors?
When you receive a 429 response, do not immediately resend the same request. It is recommended to use an Exponential Backoff strategy, gradually increasing the wait time before each retry. For batch tasks, control the rate of task submission to avoid sending a large number of requests all at once in a short period of time.
Best Practices
To avoid frequently triggering rate or concurrency limits in production environments, we recommend:
- Build your own task queue mechanism: Maintain a task queue on the application side, and control the task submission rate based on current concurrency conditions to avoid sending large numbers of generation requests at once.
- Implement exponential backoff retry: When encountering a 429, gradually increase the retry wait time and set a maximum number of retries.
- Control polling frequency appropriately: When querying task status, maintain a reasonable polling interval to avoid calling the task query endpoint too frequently.
- Use batch query endpoints: When querying multiple tasks, use the batch task query endpoint to reduce the number of API requests.
- Monitor API error rates: Monitor 429 errors in production to promptly detect issues such as traffic spikes or insufficient concurrency.
How to Increase Concurrency Quota?
If your business requires higher task concurrency, you can contact us to evaluate a concurrency quota adjustment plan. Tripo can configure higher concurrency limits individually based on specific business scenarios and task categories. To increase concurrency, please contact the Tripo business team: [email protected]
For more information on rate limits, concurrency limits, and error handling, please refer to the Tripo API Rate Limits Documentation.
