budgets

Create a budget under an id you choose, or replace the one with that id.

Every field takes the value in the body, and a field left out is cleared, so the same request always leaves the same budget. Answers 201 when it created the budget. Users on a budget it replaces stay on it, and its ceilings follow a change of reset period. A budget an organization owns is not replaced.

put/api/v1/budgets/{budget_id}

Request

  • The document declares no server URL.
  • Auth: one of:
    • API key in header Otari-Key
    • API key in header x-api-key

Path parameters

budget_idstring required

An id you choose: up to 128 letters, digits, '.', '_' and '-', starting with a letter or digit

Request body

budget_duration_secinteger nullable

Budget duration in seconds (e.g., 86400 for daily, 604800 for weekly)

max_budgetnumber nullable

Maximum spending limit

namestring nullable

Admin-facing label for the budget

request_limitinteger nullable

Maximum requests over the period. Independent of max_budget; null is unlimited

reset_alignment'calendar_day' | 'calendar_week' | 'calendar_month' nullable

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

rpm_limitinteger nullable

Requests per minute for each user on this budget, across replicas; null is unlimited

token_limitinteger nullable

Maximum tokens over the period. Independent of max_budget; null is unlimited

tpm_limitinteger nullable

Tokens per minute for each user on this budget, counted on what requests used: a request is admitted while the user's minute is under the limit. Null is unlimited

Response

Successful Response

budget_duration_secinteger nullable required
budget_idstring required
created_atstring required
max_budgetnumber nullable required
namestring nullable required
organization_idstring uuid nullable required
request_limitinteger nullable required
reset_alignmentstring nullable required
rpm_limitinteger nullable
token_limitinteger nullable required
total_reservednumber
total_spendnumber
tpm_limitinteger nullable
updated_atstring required
user_countinteger

Changes