Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.toktra.dev/llms.txt

Use this file to discover all available pages before exploring further.

List budgets

Returns a cursor-paginated list of budgets for your organization.
GET /v1/budgets
cursor
string
Opaque pagination cursor. Pass next_cursor from a previous response to fetch the next page. Omit for the first page.
limit
integer
default:"25"
Maximum items per page (1–100).

Request

curl https://api.toktra.io/v1/budgets \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

{
  "items": [
    {
      "id": "b3c1e9f2-1234-5678-abcd-000000000001",
      "org_id": "a1b2c3d4-0000-0000-0000-000000000000",
      "name": "Engineering Monthly",
      "department": "engineering",
      "amount": 50000.00,
      "spent": 32150.75,
      "remaining": 17849.25,
      "currency": "USD",
      "period": "monthly",
      "hard_cap": true,
      "created_at": "2025-01-01T00:00:00Z",
      "updated_at": "2025-01-15T10:30:00Z"
    }
  ],
  "next_cursor": "eyJpZCI6ImIzYzFlOWYyIn0",
  "has_more": true,
  "total_count": 8
}

Get budget

Returns a single budget by ID.
GET /v1/budgets/{id}
id
string
required
Budget UUID.

Request

curl https://api.toktra.io/v1/budgets/b3c1e9f2-1234-5678-abcd-000000000001 \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

{
  "id": "b3c1e9f2-1234-5678-abcd-000000000001",
  "org_id": "a1b2c3d4-0000-0000-0000-000000000000",
  "name": "Engineering Monthly",
  "department": "engineering",
  "amount": 50000.00,
  "spent": 32150.75,
  "remaining": 17849.25,
  "currency": "USD",
  "period": "monthly",
  "hard_cap": true,
  "created_at": "2025-01-01T00:00:00Z",
  "updated_at": "2025-01-15T10:30:00Z"
}

Budget object

id
string
Unique budget identifier (UUID).
org_id
string
Organization that owns this budget.
name
string
Human-readable budget name.
department
string
Department this budget applies to. null for org-wide budgets.
amount
number
Budget limit for the current period, in currency.
spent
number
Amount consumed in the current period.
remaining
number
amount minus spent.
currency
string
ISO 4217 currency code (e.g., USD).
period
string
Budget period: daily, weekly, monthly, quarterly, or annual.
hard_cap
boolean
When true, LLM requests are blocked once remaining reaches zero. When false, usage is allowed but an alert is triggered.
created_at
string
ISO 8601 creation timestamp.
updated_at
string
ISO 8601 last-updated timestamp.
To create or modify budgets, use the dashboard under Budgets or the Terraform provider.