Create or update a workspace budget
Changed onCreate or update the budget for a given interval. Budget limits must strictly decrease as the interval narrows (lifetime > monthly > weekly > daily). Requires an organization-scoped management key with both budgets:view and budgets:update. The optional include_byok_in_budgets flag is a workspace-wide setting: when provided it applies to every budget interval for the workspace, not just the interval in this request. Note that a change made here is applied to budget enforcement immediately, but an already-open workspace settings page in the web dashboard may keep showing the previous value until it is reloaded. Management key required.
Request
- Base URLhttps://openrouter.ai/api/v1
- AuthHTTP bearer
Path parameters
The workspace ID (UUID) or slug
Budget reset interval. Use "lifetime" for a one-time budget that never resets.
Request body
Whether to include BYOK (bring-your-own-key) spend when enforcing the workspace's budgets. This is a workspace-wide setting: it applies to every budget interval (daily, weekly, monthly, and lifetime), not just the interval being upserted in this request. Omit to leave the current setting unchanged.
Spending limit in USD. Must be greater than 0.
Example request
{
"include_byok_in_budgets": true,
"limit_usd": 100
}Response
Budget created or updated successfully
The created or updated budget
Whether BYOK (bring-your-own-key) spend is included when enforcing the workspace's budgets. This is a workspace-wide setting that applies to all budget intervals (daily, weekly, monthly, and lifetime).
Example response
{
"data": {
"created_at": "2025-08-24T10:30:00Z",
"id": "770e8400-e29b-41d4-a716-446655440000",
"limit_usd": 100,
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
},
"include_byok_in_budgets": true
}Changes
- info
added the non-success response with the status
- info