create_usage_limit
Set a cumulative budget for cost or tokens with optional alerts and weekly or monthly resets. Conditions and group_by fields are required to apply the limit.
Instructions
Create a cumulative budget for cost or tokens with optional alerts and weekly or monthly resets. conditions and group_by are required; use rate limits when you need request throttling.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| conditions | Yes | Array of conditions that determine which requests this usage limit applies to | |
| group_by | Yes | Array of fields to group the usage limit by (e.g., ['virtual_key'], ['api_key', 'user_id']) | |
| type | Yes | What to limit: 'cost' (in dollars) or 'tokens' | |
| credit_limit | Yes | The maximum allowed usage (cost in dollars or token count) | |
| name | No | Optional name for the usage limit | |
| alert_threshold | No | Percentage threshold (0-100) at which to send an alert | |
| periodic_reset | No | Automatically reset usage counters on this schedule | |
| workspace_id | No | Workspace ID to scope the limit to | |
| organisation_id | No | Organisation ID to scope the limit to |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool call succeeded and returned structured data | |
| data | No | Structured success payload when ok is true | |
| error | No | Structured error payload when ok is false |