Organization budgets
List the budgets this organization has defined. Owners and admins only.
Enter your API key here (sent as Otari-Key header).
Number of records to skip
0Maximum number of records to return
100Successful Response
Validation Error
GET /api/v1/organizations/me/budgets HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
"count": 1,
"data": [
{
"budget_duration_sec": 1,
"budget_id": "text",
"ceiling_count": 1,
"created_at": "text",
"max_budget": 1,
"name": "text",
"organization_id": "123e4567-e89b-12d3-a456-426614174000",
"request_limit": 1,
"reset_alignment": "text",
"token_limit": 1,
"updated_at": "text"
}
]
}Define a budget owned by this organization. Owners and admins only.
Enter your API key here (sent as Otari-Key header).
Create one budget owned by the caller's organization.
Seconds between resets, counted from the last one. Mutually exclusive with reset_alignment
Maximum spend in USD over one period; null caps nothing
Admin-facing label for the budget
Maximum requests over one period; null caps nothing. Independent of max_budget
Reset on a UTC calendar boundary instead of a fixed number of seconds, which is the only way to express a calendar month. Mutually exclusive with budget_duration_sec
Maximum tokens over one period; null caps nothing. Independent of max_budget
Successful Response
One of the organization's budgets, and how much of its own config names it.
Carries no spend rollup. BudgetResponse on the deployment surface sums
users.spend over the gateway's users table, which is deployment-wide
and has no tenancy column, so the same figure here would be a cross-tenant
read. What an organization's own spend is, is a question for Usage.
ceiling_count is the organization-relevant fact instead: how many of its
ceilings this budget currently holds, which is what makes a delete refuse.
Validation Error
POST /api/v1/organizations/me/budgets HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 121
{
"budget_duration_sec": 1,
"max_budget": 1,
"name": "text",
"request_limit": 1,
"reset_alignment": "calendar_day",
"token_limit": 1
}{
"budget_duration_sec": 1,
"budget_id": "text",
"ceiling_count": 1,
"created_at": "text",
"max_budget": 1,
"name": "text",
"organization_id": "123e4567-e89b-12d3-a456-426614174000",
"request_limit": 1,
"reset_alignment": "text",
"token_limit": 1,
"updated_at": "text"
}Change a budget's label, figure or period.
Every ceiling naming it is held to the new figure from here on, which is the point of naming a budget rather than typing an amount per place it applies.
Enter your API key here (sent as Otari-Key header).
Replace a budget's label, figure and period.
Every field is optional and keyed on model_fields_set, matching
the deployment-wide budget update's own: an omitted field is left alone, and an
explicit null clears it, so sending max_budget: null takes a budget back
to uncapped, which is what the dashboard's dialog does. The period pair is
still mutually exclusive, and setting one does not clear the other, which is
why :func:_require_single_period_source re-checks the resulting pair
rather than the submitted one.
Seconds between resets, counted from the last one. Mutually exclusive with reset_alignment
Maximum spend in USD over one period; null caps nothing
Admin-facing label for the budget
Maximum requests over one period; null caps nothing. Independent of max_budget
Reset on a UTC calendar boundary instead of a fixed number of seconds, which is the only way to express a calendar month. Mutually exclusive with budget_duration_sec
Maximum tokens over one period; null caps nothing. Independent of max_budget
Successful Response
One of the organization's budgets, and how much of its own config names it.
Carries no spend rollup. BudgetResponse on the deployment surface sums
users.spend over the gateway's users table, which is deployment-wide
and has no tenancy column, so the same figure here would be a cross-tenant
read. What an organization's own spend is, is a question for Usage.
ceiling_count is the organization-relevant fact instead: how many of its
ceilings this budget currently holds, which is what makes a delete refuse.
Validation Error
PATCH /api/v1/organizations/me/budgets/{budget_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 121
{
"budget_duration_sec": 1,
"max_budget": 1,
"name": "text",
"request_limit": 1,
"reset_alignment": "calendar_day",
"token_limit": 1
}{
"budget_duration_sec": 1,
"budget_id": "text",
"ceiling_count": 1,
"created_at": "text",
"max_budget": 1,
"name": "text",
"organization_id": "123e4567-e89b-12d3-a456-426614174000",
"request_limit": 1,
"reset_alignment": "text",
"token_limit": 1,
"updated_at": "text"
}Delete a budget, refused with 409 while a ceiling or workspace default names it.
Enter your API key here (sent as Otari-Key header).
Successful Response
A human-readable acknowledgment for an operation with nothing to return.
What happened.
Validation Error
DELETE /api/v1/organizations/me/budgets/{budget_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
"message": "text"
}List the ceilings capping identities inside this organization. Owners and admins only.
A ceiling whose budget this organization does not own is listed with manageable false rather than omitted: it is enforcing against this organization's spend, so leaving it out would let the page read as uncapped.
Enter your API key here (sent as Otari-Key header).
Number of records to skip
0Maximum number of records to return
100Successful Response
Validation Error
GET /api/v1/organizations/me/spend-ceilings HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
"count": 1,
"data": [
{
"budget_duration_sec": 1,
"budget_id": "text",
"created_at": "text",
"current_requests": 1,
"current_spend": 1,
"current_tokens": 1,
"id": "text",
"manageable": true,
"max_budget": 1,
"name": "text",
"period_end": "text",
"period_start": "text",
"provider_key_id": "text",
"request_limit": 1,
"reserved_requests": 1,
"reserved_spend": 1,
"reserved_tokens": 1,
"reset_alignment": "text",
"scope_id": "text",
"scope_type": "text",
"token_limit": 1,
"updated_at": "text"
}
]
}Cap one identity in this organization at one of its budgets.
Answers 404 when the scope names nothing in this organization, rather than creating a ceiling that can never bind, and 404 when the budget is not this organization's.
Enter your API key here (sent as Otari-Key header).
Attach one of the organization's budgets to a scope inside it.
The budget this ceiling enforces, which must be one this organization owns
Admin-facing label for this ceiling
Narrow the cap to one provider instance; omit or null to cap spend across every provider. A blank value would store a ceiling that never binds, so it is refused; this does not check that the value names a configured provider instance
^\S+$Id of the capped identity: this organization, one of its workspaces, a membership in either, or an API key in one
Which kind of identity this ceiling caps
Successful Response
One ceiling inside the organization, and the figures it enforces.
The limit and the period are read through the budget rather than stored here,
and carried on the wire so a page can render a ceiling without fetching every
budget to resolve one id. Same reasoning as ScopedBudgetResponse, whose
shape this deliberately mirrors.
Validation Error
POST /api/v1/organizations/me/spend-ceilings HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 105
{
"budget_id": "text",
"name": "text",
"provider_key_id": "text",
"scope_id": "text",
"scope_type": "organization"
}{
"budget_duration_sec": 1,
"budget_id": "text",
"created_at": "text",
"current_requests": 1,
"current_spend": 1,
"current_tokens": 1,
"id": "text",
"manageable": true,
"max_budget": 1,
"name": "text",
"period_end": "text",
"period_start": "text",
"provider_key_id": "text",
"request_limit": 1,
"reserved_requests": 1,
"reserved_spend": 1,
"reserved_tokens": 1,
"reset_alignment": "text",
"scope_id": "text",
"scope_type": "text",
"token_limit": 1,
"updated_at": "text"
}Relabel a ceiling, or point it at a different budget of this organization's.
The scope and the provider narrowing are not editable: changing either would move the ceiling to a different identity while carrying its spend, which is a delete and a create.
Enter your API key here (sent as Otari-Key header).
Relabel a ceiling, or point it at a different budget of this organization's.
The scope and the provider narrowing are not editable, for the reason the deployment-wide ceiling update gives: changing either moves the ceiling to a different identity while carrying its spend, which is a delete and a create, not an update.
Successful Response
One ceiling inside the organization, and the figures it enforces.
The limit and the period are read through the budget rather than stored here,
and carried on the wire so a page can render a ceiling without fetching every
budget to resolve one id. Same reasoning as ScopedBudgetResponse, whose
shape this deliberately mirrors.
Validation Error
PATCH /api/v1/organizations/me/spend-ceilings/{ceiling_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 34
{
"budget_id": "text",
"name": "text"
}{
"budget_duration_sec": 1,
"budget_id": "text",
"created_at": "text",
"current_requests": 1,
"current_spend": 1,
"current_tokens": 1,
"id": "text",
"manageable": true,
"max_budget": 1,
"name": "text",
"period_end": "text",
"period_start": "text",
"provider_key_id": "text",
"request_limit": 1,
"reserved_requests": 1,
"reserved_spend": 1,
"reserved_tokens": 1,
"reset_alignment": "text",
"scope_id": "text",
"scope_type": "text",
"token_limit": 1,
"updated_at": "text"
}Remove a ceiling inside this organization.
Enter your API key here (sent as Otari-Key header).
Successful Response
A human-readable acknowledgment for an operation with nothing to return.
What happened.
Validation Error
DELETE /api/v1/organizations/me/spend-ceilings/{ceiling_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
"message": "text"
}Last updated
Was this helpful?
