Chuyển đến nội dung chính

Tài liệu

Giới hạn tốc độ

Các hướng dẫn chi tiết và tài liệu tham chiếu API chỉ có bằng tiếng Anh.

What is limited

LimitValueWhen exceeded
Requests per API key300 per minute, all endpoints together429, details.scope = "key"
Job creation (POST /v1/generations, POST /v1/images/generations)per tier of the group you choose, see below429, details.scope = "plan", with the group in plan
Failed authentication from one IP address60 per minute429, details.scope = "auth"
Long polling requests per key20 at the same timethe request returns at once with the current state
Jobs waiting in the queue20 per account429 queue_full
Jobs running at the same timeper tierextra jobs wait in the queue (pending), they are not rejected

Job creation per minute

The limit follows the plan group named in the plan field of the request, at the tier you have in that group. Without a plan in that group the free level applies.

GroupTierCreations per minuteJobs running at once
Studiostarter201
Studiopro402
Studioscale804
Creditsstarter302
Creditspro604
Creditsbusiness1208
no planfree101

GET /v1/account shows the values that apply to your account (create_rpm and concurrency of each group).

Response headers

Every response has:

  • X-RateLimit-Limit: the limit that applies to the request,
  • X-RateLimit-Remaining: requests left in the current minute,
  • X-RateLimit-Reset: the Unix time when the minute ends.

On job creation these describe the limit of the chosen plan group; on other endpoints, the per key limit. A 429 always carries Retry-After, the seconds to wait.

Handling 429

  1. Read Retry-After and wait that long.
  2. Retry with the same Idempotency-Key, so a request that was in fact accepted is not charged twice.
  3. Spread bursts: a worker pool of a few parallel requests is better than hundreds at once.

Windows are fixed minutes (they reset at the start of each minute), so Retry-After is the time left in the current minute.