Create a limit policy
Create a usage cap. The policy takes effect immediately: alert rules notify, and block rules reject gateway requests with 429 once the cap is reached.
Authentication
Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.
Request
Identity to meter. For composites (compose length >= 2), a JSON list of values in compose order.
What the cap counts. cost is US dollars, token_count is total tokens, request_count is calls.
Named bucket, integer-seconds string, or null for cumulative.
Response
Display category (e.g. API Key, Model). Not used for matching.
Identity to meter. For composites, a JSON list of values in compose order.
Empty for single-dimension policies. Members: organization_id, api_key_id, user_id, customer_identifier, model, endpoint.
What the cap counts. cost is US dollars, token_count is total tokens, request_count is calls.
balance_fixed_window is the shipped algorithm. token_bucket is reserved and not yet enforced.
Cadence. A named bucket (minute, hour, day, week, month), a positive integer of seconds as a string, or null for a cumulative (lifetime) cap that never resets.
When a recurring window aligns. calendar resets on the boundary (e.g. the 1st of the month).
Required when anchor is not calendar.
Active-range start. null = live since forever.
Active-range end. null = live until deactivated. Must be after effective_at.
First hard-rule threshold; falls back to the largest soft threshold.