Update Budgets and Access Policy
/v1/workspaces/{workspace_id}/guardrailsOverview
Owners and admins only. A budget set to a number replaces that period's limit, null removes it, and periods left out stay as they are. access_policy replaces the whole policy; an empty object or null removes it. An invalid rule is refused with 400 and param naming it, such as access_policy.allowed_models.1.
Parameters
workspace_idpath · stringRequiredWorkspace id.
Request Body
budgetsobjectA number sets that period's limit in USD, null removes it, and periods left out stay as they are.
Show nested fields
dailynumber | nullMinimum 0 · Maximum 1000000
weeklynumber | nullMinimum 0 · Maximum 1000000
monthlynumber | nullMinimum 0 · Maximum 1000000
access_policyobject | nullShow nested fields
Option 1: object
allowed_modelsstring[]Show nested fields
See the OpenAPI schema for this nested object.
blocked_modelsstring[]Show nested fields
See the OpenAPI schema for this nested object.
allowed_providersstring[]Show nested fields
See the OpenAPI schema for this nested object.
blocked_providersstring[]Show nested fields
See the OpenAPI schema for this nested object.
allowed_productsstring[]Show nested fields
See the OpenAPI schema for this nested object.
blocked_productsstring[]Show nested fields
See the OpenAPI schema for this nested object.
Option 2: null
null
Responses
200Saved budgets, spend and access policy.
workspace_idstringRequiredbudgetsobjectRequiredSpend limits in USD per UTC calendar period. null means no limit.
Show nested fields
dailynumber | nullRequiredMinimum 0
weeklynumber | nullRequiredWeeks start on Monday.
Minimum 0
monthlynumber | nullRequiredMinimum 0
usageobjectRequiredUSD spent in the current UTC day, week and month, and in total, including holds for requests in progress. Spend counts in the period its request started.
Show nested fields
dailynumberRequiredweeklynumberRequiredmonthlynumberRequiredtotalnumberRequiredresets_atobjectRequiredWhen the current day, week and month end, in UTC.
Show nested fields
dailystringRequiredweeklystringRequiredmonthlystringRequiredaccess_policyobject | nullRequiredShow nested fields
Option 1: object
allowed_modelsstring[]Show nested fields
See the OpenAPI schema for this nested object.
blocked_modelsstring[]Show nested fields
See the OpenAPI schema for this nested object.
allowed_providersstring[]Show nested fields
See the OpenAPI schema for this nested object.
blocked_providersstring[]Show nested fields
See the OpenAPI schema for this nested object.
allowed_productsstring[]Show nested fields
See the OpenAPI schema for this nested object.
blocked_productsstring[]Show nested fields
See the OpenAPI schema for this nested object.
Option 2: null
null
400Request validation failed.
errorobjectRequiredShow nested fields
codestringRequiredmessagestringRequiredparamstring | nullrequest_idstring | nullmetadataobjectTyped detail for some refusals. budget_exceeded (402): limit (key_budget or workspace_budget) and budget with scope, period, limit, usage and resets_at. key_limit_exceeded (402): limit key_spend_limit. access_denied (403): policy (workspace or key), rule (models, providers or products), product, provider and model.
401Authentication is missing or invalid.
errorobjectRequiredShow nested fields
codestringRequiredmessagestringRequiredparamstring | nullrequest_idstring | nullmetadataobjectTyped detail for some refusals. budget_exceeded (402): limit (key_budget or workspace_budget) and budget with scope, period, limit, usage and resets_at. key_limit_exceeded (402): limit key_spend_limit. access_denied (403): policy (workspace or key), rule (models, providers or products), product, provider and model.
403Authenticated principal lacks permission.
errorobjectRequiredShow nested fields
codestringRequiredmessagestringRequiredparamstring | nullrequest_idstring | nullmetadataobjectTyped detail for some refusals. budget_exceeded (402): limit (key_budget or workspace_budget) and budget with scope, period, limit, usage and resets_at. key_limit_exceeded (402): limit key_spend_limit. access_denied (403): policy (workspace or key), rule (models, providers or products), product, provider and model.