Limit types
Both limits use Redis atomic counters with a 60-second TTL. The check and increment happen in a single Lua script — no race condition across replicas.
When limits are hit
retry_after is the number of seconds until the current window resets.
Setting limits
Console
Console → Keys & Limits — edit the key and set RPM/TPM in the Rate limits section.REST API
null to remove that limit.
See the full endpoint reference: PATCH /v1/keys/{id}/limits — accepted fields and error responses.
User-level limits
In addition to per-key limits, you can set limits on a user account that cap their total usage across all keys they own. Configure the per-user caps in Console → Keys & Limits.Recommended limits by use case
For production applications, monthly budget is usually the right control; RPM/TPM are better suited for preventing runaway loops.