Skip to main content
A quota rule caps a measured quantity, such as tokens, requests, images, audio seconds, or spending, over a period. Quotas belong to your account, not a workspace, so there is no workspace_id. Reads need quotas:read and writes need quotas:write. Quotas cannot be created through the API. There is no POST /api/v1/quotas.

List quotas

string
ROLLING for a sliding window, or CALENDAR for a fixed window.
integer
The cap for the period. -1 means unlimited.
boolean
true for rules derived from your plan. System rules are read-only, and their id is prefixed with system_.
object
The model the rule applies to, as { id, name, display_name }, or null when the rule applies to the whole account.

Rule types

A rule’s type names what is being measured and over what period. Each prefix combines with a measure: INPUT_TOKENS, OUTPUT_TOKENS, TOTAL_TOKENS, CACHE_INPUT_TOKENS, CACHE_OUTPUT_TOKENS, CACHE_TOTAL_TOKENS (CACHE_TOKENS on TOTAL_), REQUESTS, IMAGES, AUDIO_SECONDS, and SPENDING. DAILY_SEARCHES and DAILY_DEEP_SEARCHES are also available. System rules additionally report RATE_LIMIT_PER_MINUTE, MAX_PROVIDERS, MAX_QUOTA_RULES, and MAX_MODELS. Those types appear only when is_system is true.

Get a quota

Update a quota

PATCH is a full replace. name, type, limit, and model_id are required on every update. Updating a system_ rule returns 403.
string
required
4 to 32 characters, letters, numbers, and underscores only. Stored lowercased.
string
required
One of the rule types above.
integer
required
Between -1 and 999000000. -1 means unlimited.
string
required
The model the rule applies to.
string
default:"ROLLING"
ROLLING or CALENDAR.
boolean
default:"true"
Whether the rule is enforced.

Delete a quota

Deleting a system_ rule returns 403.