Guide to Concurrency, Queue, and Rate Limit
Understanding Leonardo API's concurrency, queue/pending limits, and rate limits
When planning to use the Leonardo API in production at scale, it is important to understand the differences between the following key concepts:
- Concurrency — the number of generation jobs (image, video, audio, 3D, etc.) that can be processed in parallel.
- Queue/Pending Limit — the maximum number of requests allowed to wait for processing when all concurrent slots are occupied.
- API Rate Limit — the maximum number of API requests that can be made in a given time period.
The Restaurant Metaphor
If Leonardo's API service were a restaurant, and generation jobs like image generation, video generation, audio generation, upscaling, etc. were meals or dishes, then:
- Concurrency is the number of cooking stations.
Concurrency refers to the number of active kitchen stations or stoves, each able to prepare a dish simultaneously. For example, if there are 10 cooking stations, the kitchen can work on 10 meals at the same time. When all stations are occupied, new orders must wait their turn. - Queue/Pending Limit is the number of dish orders accepted by the kitchen.
This limit represents how many dish orders the kitchen will accept and keep in line for cooking when all stations are busy. If the queue is full, the kitchen won't take more orders until some are finished — similar to a busy restaurant temporarily stopping new orders when overwhelmed. - API Rate Limit is waiter capacity for taking orders from tables.
The rate limit is like how many waiters are available to take new orders from the dining area. Each waiter can only write down and pass on a certain number of orders per minute before becoming overwhelmed. If too many orders come in at once, some must wait for the next round.
| Concept | Technical Definition | Restaurant Metaphor |
|---|---|---|
| Concurrency | Number of parallel generation jobs | Number of cooking stations |
| Queue/Pending Limit | Number of pending generation jobs | Number of orders accepted by kitchen waitlist |
| API Rate Limit | Number of API requests within a given timeframe | Waiter capacity or availability |
Default Limits
The limits below apply to both v1 and v2 endpoints. Both API versions go through the same generation service, so a request counts toward the same account-level limits whichever version you call.
Image, video, audio, and 3D generations all share these limits. There are no separate limits for audio or 3D generation.
Your limits scale with the number of concurrency slots on your account. Every API account starts with 10 slots.
| Concurrency slots | Concurrent generations | Generations with status PENDING | Generation requests per minute |
|---|---|---|---|
| 10 (Default) | 10 | 1 | 100 |
| More than 10 (Custom API Plan) | slots × 20 | slots × 20 | slots × 10 |
Note:
- Concurrency slots cap how many generations your account can run at once through the API, across all models.
- Rate limits above apply to production API keys.
- Across all endpoints and request types (including
GETrequests), the overall rate limit is 2000 requests per minute.
Other default limits
| Description | Limit |
|---|---|
| Concurrent Blueprints execution job | 10 (Default) |
| Concurrent model training job | 5 (Default) |
Rate limits by endpoint
| Request Type | Endpoint | Limit |
|---|---|---|
| All request types | All | 2000 per minute (Default) |
| Create a Generation (image, video, audio, 3D) requests | /v2/generations | 100 per minute (Default) |
| Create a Generation of Images requests | /v1/generations | 100 per minute (Default) |
| Create using Universal Upscaler requests | /v1/variations/universal-upscaler | 100 per minute (Default) |
| Create unzoom requests | /v1/variations/unzoom | 100 per minute (Default) |
| Create upscale requests | /v1/variations/upscale | 100 per minute (Default) |
| Create no background requests | /v1/variations/nobg | 100 per minute (Default) |
| Create Texture Generation requests | /v1/generations-texture | 100 per minute (Default) |
| Execute Blueprints | /v1/blueprint-executions | 100 per minute (Default) |
Model-specific concurrency
Some video models have their own concurrency limit, separate from your account's concurrency slots. When a model has its own limit, the lower of the two applies.
| Model | Model concurrency limit |
|---|---|
| Veo 3.1 | 8 |
| Veo 3.1 Fast, Veo 3.1 Lite | 8 |
| Kling 3.0 | 15 |
| Kling O3 | 15 |
Note:
- With the default 10 concurrency slots, you can run up to 8 Veo 3.1 generations at once, because the model's limit (8) is lower than your account's limit (10).
- With the default 10 concurrency slots, you can run up to 10 Kling 3.0 generations at once, because your account's limit (10) is lower than the model's limit (15). The model's limit of 15 only matters once your account has more than 15 slots.
- Model-specific limits count all of your generations with that model, including generations made in the Leonardo web app, not only API requests.
- All other models follow your account's concurrency slots.
What happens when you exceed a limit
| Limit exceeded | What happens |
|---|---|
| Concurrency | The request is accepted and waits in the queue with status PENDING until a slot frees up, as long as the queue is not full. |
| Queue/Pending Limit | The request is rejected. Retry once a slot frees up. |
| API Rate Limit | The request is rejected. Retry after the current minute has passed. |
See API Error Messages for the full list of errors.
To stay within the default limits, track the status of your in-progress generations (for example, with the webhook callback) and send new requests as slots free up, rather than submitting all requests at once.
Increase your limits
These limits can be customized with a Custom API Plan by reaching out via Leonardo's contact form.
To help size your plan correctly, please share the following information:
- How many images, videos, or other generations do you anticipate generating per month?
- Do you expect occasional, spiky usage or predictable, steady demand?
- Which models do you plan to use? Some video models have their own concurrency limits.
Leonardo API for EnterpriseIn addition to the Custom API Plan, Leonardo.Ai provides enterprise-grade, high-volume access by leveraging dedicated infrastructure that can support millions of active users. For advanced scalability or large-scale API deployment, contact our team through Leonardo's contact form for a tailored solution.
Common Misconceptions
Misconception 1: You can't make more than 10 generation requests because the default concurrency is 10.
Concurrency limits the number of generation jobs actively processed at the same time, like the number of cooking stations in a kitchen. It doesn't limit how many requests you can send in total. Once a job finishes, its concurrency slot frees up for the next request.
With the default limits, 10 jobs can run at once and 1 more can wait in the queue. If you send more than that before a slot frees up, the extra requests are rejected (see What happens when you exceed a limit). Track your in-progress jobs and send new requests as slots free up, or contact us about a Custom API Plan for a larger queue.
Misconception 2: I have more than 10 users accessing my app so I need more concurrency.
The number of users does not automatically mean you need more concurrency. Imagine a kitchen with 10 stoves serving dozens or even hundreds of diners efficiently by processing orders as stoves become available. If your app manages its own request queue and sends generations to Leonardo as slots free up, 10 concurrency slots can serve many users.
Misconception 3: More concurrency slots means I can run more generations with every model.
Some video models, such as Veo 3.1, have their own concurrency limit. The lower of your account's limit and the model's limit applies. For example, an account with 20 concurrency slots can still only run 8 Veo 3.1 generations at once.
Updated about 3 hours ago
