Skip to main content
Rate limits cap requests per minute (RPM) and tokens per minute (TPM) per virtual key. Like budgets, they are enforced atomically in Redis before the request reaches a provider.

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

Set either field to 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. For production applications, monthly budget is usually the right control; RPM/TPM are better suited for preventing runaway loops.