Rate limits
How many API requests a key and a workspace can make each minute, the headers that show what is left, and how to back off on a 429.
The API limits requests per minute in two ways: per API key, and per workspace across all keys together. Generation and change calls also have a tighter window.
Limits
Generation and change calls are:
Such a call counts toward the general window and the generation window. Job reads (GET /jobs/{jobId}) and job streams count toward the key and workspace general windows.
Account calls that have no workspace in the path (/key, /credits, /carousel-templates) count against the per-key window only.
Headers
Calls to the API answer with these headers:
When more than one window applies, the headers show the one with fewer calls left. For example, a generation call right after you started shows RateLimit-Limit: 20, the generation window.
When you hit a limit
The API answers 429 with code rate_limited and a Retry-After header:
Wait Retry-After seconds, then retry. For calls that spend credits, retry with the same Idempotency-Key. A call refused with 429 did not run and was not charged. Spread large batches over time instead of sending them at once.
The limiter fails closed
If PostChamp cannot reach its rate-limit store, it refuses the call with 429 rate_limited and a Retry-After of 60 seconds (“This is busy right now. Try again in a minute.”) instead of letting it through. Retry after the delay.
Open streams
A key can hold a limited number of open job streams at a time. Past it the stream request answers 429 rate_limited with Retry-After: 5. Close a stream you no longer need. See Jobs and streaming.
Other limits are separate
These are not request limits, and they have their own errors:
See Errors and Plans and credits.