Skip to main content
GET
/
v2
/
budgets
List budgets
curl --request GET \
  --url https://api.orq.ai/v2/budgets \
  --header 'Authorization: Bearer <token>'
{
  "object": "<string>",
  "data": [
    {
      "budget_id": "<string>",
      "workspace_id": "<string>",
      "scope": {
        "workspace": {},
        "project": {
          "project_id": "<string>"
        },
        "identity": {
          "identity_external_id": "<string>"
        },
        "api_key": {
          "api_key_id": "<string>"
        },
        "provider": {
          "provider": "<string>"
        },
        "model": {
          "model_id": "<string>"
        }
      },
      "limits": {
        "amount": 123,
        "token_limit": "<string>"
      },
      "rate_limit": {
        "requests_per_minute": 123
      },
      "is_active": true,
      "expires_at": "2023-11-07T05:31:56Z",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z"
    }
  ],
  "has_more": true
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

limit
integer<int32>

Page size, 1–200. Unset uses the server default (25).

starting_after
string

Cursor for forward pagination. Set to the budget_id of the last item from the previous page.

ending_before
string

Cursor for backward pagination. Set to the budget_id of the first item from the previous page.

scope_kind
enum<string>[]

Optional filter: only return budgets whose scope kind matches one of the listed values. Empty means no scope-kind filter.

Available options:
BUDGET_SCOPE_KIND_UNSPECIFIED,
BUDGET_SCOPE_KIND_WORKSPACE,
BUDGET_SCOPE_KIND_PROJECT,
BUDGET_SCOPE_KIND_IDENTITY,
BUDGET_SCOPE_KIND_API_KEY,
BUDGET_SCOPE_KIND_PROVIDER,
BUDGET_SCOPE_KIND_MODEL
scope_target_id
string

Optional filter: only return budgets whose scope target id matches.

is_active
boolean

Optional filter: only return budgets with this active state.

period
enum<string>[]

Optional filter: only return budgets whose limits.period matches one of the listed values. Empty means no period filter.

Available options:
BUDGET_PERIOD_UNSPECIFIED,
BUDGET_PERIOD_DAILY,
BUDGET_PERIOD_WEEKLY,
BUDGET_PERIOD_MONTHLY,
BUDGET_PERIOD_YEARLY,
BUDGET_PERIOD_ONE_TIME
query
string

Optional free-text query. Server translates this into a Typesense search over the denormalized scope_target_name and id fields on the per-workspace {workspace_id}_budgets collection.

Response

200 - application/json

OK

object
string

Object discriminator for list responses; always list.

data
object[]

Page of budgets, ordered newest first.

has_more
boolean

Whether more budgets are available in the selected pagination direction.