Skip to content

Get Budgets and Access Policy

GET/v1/workspaces/{workspace_id}/guardrails

Overview

Daily, weekly and monthly budgets with this period's spend and when each period resets, and the access policy. Any member's dashboard session can read them. Periods are UTC calendar days, weeks starting Monday, and months.

Authorization

Authorizationstring · headerRequired

Workspace session token sent as Bearer <token>. Authentication guide

Parameters

workspace_idpath · stringRequired

Workspace id.

Responses

200Budgets, spend and access policy.
application/json
workspace_idstringRequired
budgetsobjectRequired

Spend limits in USD per UTC calendar period. null means no limit.

Show nested fields
dailynumber | nullRequired

Minimum 0

weeklynumber | nullRequired

Weeks start on Monday.

Minimum 0

monthlynumber | nullRequired

Minimum 0

usageobjectRequired

USD 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
dailynumberRequired
weeklynumberRequired
monthlynumberRequired
totalnumberRequired
resets_atobjectRequired

When the current day, week and month end, in UTC.

Show nested fields
dailystringRequired
weeklystringRequired
monthlystringRequired
access_policyobject | nullRequired
Show 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

401Authentication is missing or invalid.
application/json
errorobjectRequired
Show nested fields
codestringRequired
messagestringRequired
paramstring | null
request_idstring | null
metadataobject

Typed 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.
application/json
errorobjectRequired
Show nested fields
codestringRequired
messagestringRequired
paramstring | null
request_idstring | null
metadataobject

Typed 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.