For the complete documentation index, see llms.txt. This page is also available as Markdown.

Organization budgets

List Organization Budgets

get

List the budgets this organization has defined. Owners and admins only.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
skipintegerOptional

Number of records to skip

Default: 0
limitinteger · min: 1 · max: 1000Optional

Maximum number of records to return

Default: 100
Responses
200

Successful Response

application/json
countintegerRequired
get/api/v1/organizations/me/budgets
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"
    }
  ]
}

Create Organization Budget

post

Define a budget owned by this organization. Owners and admins only.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Body

Create one budget owned by the caller's organization.

budget_duration_secinteger · nullableOptional

Seconds between resets, counted from the last one. Mutually exclusive with reset_alignment

max_budgetnumber · max: 999999999999 · nullableOptional

Maximum spend in USD over one period; null caps nothing

namestring · max: 200 · nullableOptional

Admin-facing label for the budget

request_limitinteger · max: 1000000000000000 · nullableOptional

Maximum requests over one period; null caps nothing. Independent of max_budget

reset_alignmentstring · enum · nullableOptional

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

Possible values:
token_limitinteger · max: 1000000000000000 · nullableOptional

Maximum tokens over one period; null caps nothing. Independent of max_budget

Responses
201

Successful Response

application/json

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.

budget_duration_secinteger · nullableRequired
budget_idstringRequired
ceiling_countintegerRequired
created_atstringRequired
max_budgetnumber · nullableRequired
namestring · nullableRequired
organization_idstring · uuidRequired
request_limitinteger · nullableRequired
reset_alignmentstring · nullableRequired
token_limitinteger · nullableRequired
updated_atstringRequired
post/api/v1/organizations/me/budgets
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"
}

Update Organization Budget

patch

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
budget_idstringRequired
Body

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.

budget_duration_secinteger · nullableOptional

Seconds between resets, counted from the last one. Mutually exclusive with reset_alignment

max_budgetnumber · max: 999999999999 · nullableOptional

Maximum spend in USD over one period; null caps nothing

namestring · max: 200 · nullableOptional

Admin-facing label for the budget

request_limitinteger · max: 1000000000000000 · nullableOptional

Maximum requests over one period; null caps nothing. Independent of max_budget

reset_alignmentstring · enum · nullableOptional

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

Possible values:
token_limitinteger · max: 1000000000000000 · nullableOptional

Maximum tokens over one period; null caps nothing. Independent of max_budget

Responses
200

Successful Response

application/json

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.

budget_duration_secinteger · nullableRequired
budget_idstringRequired
ceiling_countintegerRequired
created_atstringRequired
max_budgetnumber · nullableRequired
namestring · nullableRequired
organization_idstring · uuidRequired
request_limitinteger · nullableRequired
reset_alignmentstring · nullableRequired
token_limitinteger · nullableRequired
updated_atstringRequired
patch/api/v1/organizations/me/budgets/{budget_id}
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 Organization Budget

delete

Delete a budget, refused with 409 while a ceiling or workspace default names it.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
budget_idstringRequired
Responses
200

Successful Response

application/json

A human-readable acknowledgment for an operation with nothing to return.

messagestringRequired

What happened.

delete/api/v1/organizations/me/budgets/{budget_id}
DELETE /api/v1/organizations/me/budgets/{budget_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
  "message": "text"
}

List Organization Spend Ceilings

get

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
skipintegerOptional

Number of records to skip

Default: 0
limitinteger · min: 1 · max: 1000Optional

Maximum number of records to return

Default: 100
Responses
200

Successful Response

application/json
countintegerRequired
get/api/v1/organizations/me/spend-ceilings
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"
    }
  ]
}

Create Organization Spend Ceiling

post

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Body

Attach one of the organization's budgets to a scope inside it.

budget_idstring · min: 1 · max: 255Required

The budget this ceiling enforces, which must be one this organization owns

namestring · max: 200 · nullableOptional

Admin-facing label for this ceiling

provider_key_idstring · min: 1 · max: 255 · nullableOptional

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

Pattern: ^\S+$
scope_idstring · min: 1 · max: 255Required

Id of the capped identity: this organization, one of its workspaces, a membership in either, or an API key in one

scope_typestring · enumRequired

Which kind of identity this ceiling caps

Possible values:
Responses
201

Successful Response

application/json

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.

budget_duration_secinteger · nullableRequired
budget_idstringRequired
created_atstringRequired
current_requestsintegerRequired
current_spendnumberRequired
current_tokensintegerRequired
idstringRequired
manageablebooleanRequired
max_budgetnumber · nullableRequired
namestring · nullableRequired
period_endstring · nullableRequired
period_startstring · nullableRequired
provider_key_idstring · nullableRequired
request_limitinteger · nullableRequired
reserved_requestsintegerRequired
reserved_spendnumberRequired
reserved_tokensintegerRequired
reset_alignmentstring · nullableRequired
scope_idstringRequired
scope_typestringRequired
token_limitinteger · nullableRequired
updated_atstringRequired
post/api/v1/organizations/me/spend-ceilings
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"
}

Update Organization Spend Ceiling

patch

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
ceiling_idstringRequired
Body

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.

budget_idstring · min: 1 · max: 255 · nullableOptional
namestring · max: 200 · nullableOptional
Responses
200

Successful Response

application/json

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.

budget_duration_secinteger · nullableRequired
budget_idstringRequired
created_atstringRequired
current_requestsintegerRequired
current_spendnumberRequired
current_tokensintegerRequired
idstringRequired
manageablebooleanRequired
max_budgetnumber · nullableRequired
namestring · nullableRequired
period_endstring · nullableRequired
period_startstring · nullableRequired
provider_key_idstring · nullableRequired
request_limitinteger · nullableRequired
reserved_requestsintegerRequired
reserved_spendnumberRequired
reserved_tokensintegerRequired
reset_alignmentstring · nullableRequired
scope_idstringRequired
scope_typestringRequired
token_limitinteger · nullableRequired
updated_atstringRequired
patch/api/v1/organizations/me/spend-ceilings/{ceiling_id}
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"
}

Delete Organization Spend Ceiling

delete

Remove a ceiling inside this organization.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
ceiling_idstringRequired
Responses
200

Successful Response

application/json

A human-readable acknowledgment for an operation with nothing to return.

messagestringRequired

What happened.

delete/api/v1/organizations/me/spend-ceilings/{ceiling_id}
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?