> ## Documentation Index
> Fetch the complete documentation index at: https://openrouter.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# KeyBudget

One budget layer that applies to requests made with this key, with the spend enforcement compares against it.

## Fields

| Field | Type | Required | Description | Example |
| - | - | - | - | - |
| `budget_id` | *Nullable\[str]* | ✅ | ID of the workspace budget for the `workspace` scope; null for other scopes. | null |
| `guardrail_id` | *Nullable\[str]* | ✅ | ID of the guardrail that carries this budget; null for other scopes. | 0df9e665-d932-5740-b2c7-b52af166bc11 |
| `include_byok` | *bool* | ✅ | Whether external BYOK inference spend counts toward this budget. | false |
| `limit_usd` | *float* | ✅ | Budget limit in USD for the current window. | 50 |
| `remaining_usd` | *float* | ✅ | `limit_usd - spend_usd`. Zero or negative means this layer rejects requests with a 403 until it resets. | 17.5 |
| `reset_interval` | [Nullable\[components.KeyBudgetResetInterval\]](../components/keybudgetresetinterval.mdx) | ✅ | UTC window the spend is counted over (weeks start Monday); null for a lifetime budget that never resets. | weekly |
| `resets_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | ✅ | ISO 8601 UTC instant at which the window rolls over and spend returns to zero; null for a lifetime budget. | 2026-10-12T00:00:00.000Z |
| `scope` | [components.KeyBudgetScope](../components/keybudgetscope.mdx) | ✅ | Which budget layer this is, in the order enforcement checks them: the workspace default guardrail against the member aggregate (`workspace_default_member`) and against this key (`workspace_default_key`), the member guardrail (`member`), the API key guardrail (`api_key`), a workspace budget (`workspace`), or the key's own limit (`key_limit`). | member |
| `spend_usd` | *float* | ✅ | Spend in USD that enforcement counts against this limit in the current window: the member aggregate for member-scoped layers, otherwise this key or workspace. | 32.5 |
