mistralM

Docs

sideBar

Beta Admin Billing

(beta) Admin API - manage spend limits, rate limits and roles. Requires an admin API key.

POST /v1/admin/usage/query

Detailed Usage Query

Query the organization's detailed usage for a required time range.

Optional filters, caller-selected grouping and time buckets, pagination, aggregates, and distinct API-call counts are supported. The response contains usage quantities only; it does not include prices, currency, or calculated costs. For a fixed monthly report with pricing, use GET /v1/admin/usage.

Security

AdminApiKey
bearerhttp

Request Example

{
  "end": "2026-09-01T00:00:00Z",
  "start": "2026-08-01T00:00:00Z"
}

Request Body

api_key_id
array<string> | null

API key IDs to include.

api_zone
array<string> | null

Inference regions to include.

billing_display_name
array<string> | null

Customer-facing billing metric names to include.

billing_group
array<string> | null

Billing metric components to include.

billing_metric
array<string> | null

Billing metric identifiers to include.

end
date-time* required

Exclusive end of the usage interval.

Example:

2026-09-01T00:00:00Z
filters
array<AdminUsageQueryFilter> | null

Additional inclusion or exclusion filters applied alongside the dimension fields.

AdminUsageQueryFilter
field
"usage_type" | "billing_metric" | "billing_display_name" | "billing_group" | "workspace_id" | "organization_id" | "user_id" | "service_account_id" | "api_key_id" | "api_zone" | "service_tier" | "call_source" | "call_type" | "user_agent" | "resource_id" | "resource_version"* required

Usage dimension to filter.

Example:

billing_metric
operator
"is" | "is_not"* required

Whether rows must match or must not match the supplied values.

Example:

is
values
array<string | null>Min Items: 1* required

Accepted or excluded values. Use null to filter missing dimension values.

group_by
array<"api_zone" | "service_tier" | "customer_id" | "usage_type" | "billing_metric" | "billing_group" | "billing_display_name" | "workspace_id" | "organization_id" | "user_id" | "service_account_id" | "api_key_id" | "untracked" | "call_source" | "call_type" | "user_agent" | "customer_tier" | "resource_id" | "resource_version"> | null

Dimensions used to group the returned usage rows.

include_aggregates
boolean

Return aggregates computed over the complete filtered result set.

Example:

true

Default Value: false

include_nb_api_calls
boolean

Include the number of distinct API calls in grouped rows and aggregates.

Example:

true

Default Value: false

limit
integer | null

Maximum number of grouped rows to return.

Example:

1000
offset
integer | null

Number of grouped rows to skip.

Example:

0
organization_id
array<string> | null

Organization IDs to include within the authenticated customer.

service_account_id
array<string> | null

Service account IDs to include.

service_tier
array<string> | null

Service tiers to include.

start
date-time* required

Inclusive start of the usage interval.

Example:

2026-08-01T00:00:00Z
time_bucket
"second" | "1min" | "5min" | "15min" | "30min" | "hour" | "4hours" | "day" | "week" | "month"

Time interval used to bucket grouped rows.

Example:

day
untracked
boolean | null

Filter by attribution status. Omit or use null to include both tracked and untracked usage.

Example:

false
usage_type
array<"usage" | "codestral" | "document_library" | "document_library_api" | "libraries_pages" | "libraries_tokens" | "libraries_audio" | "chat" | "rlhf" | "ocr" | "audio_seconds" | "audio_characters" | "audio_agents" | "connectors" | "workflow_executions" | "skill_activations" | "managed_index_storage_bytes" | "managed_index_written_bytes" | "managed_index_searches" | "vibe" | "vibe_connectors" | "vibe_ocr" | "vibe_audio_seconds" | "vibe_audio_characters"> | null

Usage event types to include.

user_id
array<string> | null

User IDs to include.

workspace_ids
array<string | null> | null

Workspace IDs to include. Use null to include usage without a workspace.

Responses

Successful Response

aggregates
UsageQueryAggregatesOUT | null

Aggregates over the complete filtered result set when requested.

UsageQueryAggregatesOUT

Aggregates over the complete filtered result set when requested.

customer_count
integer* required

Number of matching customers.

Example:

1
total_api_calls
integer* required

Total number of distinct API calls.

Example:

10
total_count
integer* required

Total number of matching usage records.

Example:

12
total_value
number* required

Total usage value across all matching rows.

Example:

1500
usage_type_count
integer* required

Number of matching usage types.

Example:

2
groups
array<UsageQueryRowOUT>* required

Grouped usage rows.

UsageQueryRowOUT
api_key_id
string | null

API key ID.

Example:

api-key-id
api_zone
string | null

Inference region.

Example:

us
billing_display_name
string | null

Customer-facing billing metric name.

Example:

mistral-large-latest
billing_group
string | null

Billing metric component.

Example:

input
billing_metric
string | null

Billing metric identifier.

Example:

mistral-large
call_source
string | null

Product source of the call.

Example:

api
call_type
string | null

Type of call within its source.

Example:

completion
count
integer | null

Number of usage records in this row.

Example:

12
customer_id
string | null

Customer ID for this row.

Example:

customer-id
customer_tier
string | null

Customer tier.

Example:

enterprise
nb_api_calls
integer | null

Number of distinct API calls.

Example:

10
organization_id
string | null

Organization ID.

Example:

organization-id
resource_id
string | null

ID of the resource the usage is attributed to, such as a workflow ID.

Example:

0199a6f5-7c3e-7b1a-9d2e-4f5a6b7c8d9e
resource_version
string | null

Version of the resource the usage is attributed to, when the resource is versioned.

Example:

1
service_account_id
string | null

Service account ID.

Example:

service-account-id
service_tier
string | null

Service tier.

Example:

standard
time_bucket
date-time | null

Start of the UTC time bucket, expressed using the request start timestamp's UTC offset.

Example:

2026-08-01T00:00:00Z
timestamp
date-time | null

Timestamp of an unbucketed usage row, expressed using the request start timestamp's UTC offset.

Example:

2026-08-01T12:00:00Z
untracked
boolean | null

Whether attribution was unavailable.

Example:

false
usage_type
string | null

Usage event type.

Example:

usage
user_agent
string | null

Harness identified from the request User-Agent header.

Example:

claude_code
user_id
string | null

User ID.

Example:

user-id
value
integer | null

Total usage value for this row.

Example:

1500
workspace_id
string | null

Workspace ID.

Example:

workspace-id
metadata
UsageQueryMetadataOUT* required
UsageQueryMetadataOUT
has_more
boolean* required

Whether another page of grouped rows is available.

Example:

false
query_params
UsageQueryParamsOUT* required
UsageQueryParamsOUT
api_key_id
array<string> | null

API key IDs to include.

api_zone
array<string> | null

Inference regions to include.

billing_display_name
array<string> | null

Customer-facing billing metric names to include.

billing_group
array<string> | null

Billing metric components to include.

billing_metric
array<string> | null

Billing metric identifiers to include.

customer_id
string | null

Customer scope derived from the authenticated Admin API key.

Example:

69bc23d6-4db3-47ad-9cce-bda1b24509f2
end
date-time* required

Exclusive end of the queried interval.

Example:

2026-09-01T00:00:00Z
filters
array<AdminUsageQueryFilter> | null

Additional inclusion or exclusion filters applied alongside the dimension fields.

AdminUsageQueryFilter
field
"usage_type" | "billing_metric" | "billing_display_name" | "billing_group" | "workspace_id" | "organization_id" | "user_id" | "service_account_id" | "api_key_id" | "api_zone" | "service_tier" | "call_source" | "call_type" | "user_agent" | "resource_id" | "resource_version"* required

Usage dimension to filter.

Example:

billing_metric
operator
"is" | "is_not"* required

Whether rows must match or must not match the supplied values.

Example:

is
values
array<string | null>Min Items: 1* required

Accepted or excluded values. Use null to filter missing dimension values.

group_by
array<"api_zone" | "service_tier" | "customer_id" | "usage_type" | "billing_metric" | "billing_group" | "billing_display_name" | "workspace_id" | "organization_id" | "user_id" | "service_account_id" | "api_key_id" | "untracked" | "call_source" | "call_type" | "user_agent" | "customer_tier" | "resource_id" | "resource_version"> | null

Dimensions used to group the returned usage rows.

include_nb_api_calls
boolean

Whether distinct API-call counts were requested.

Example:

true

Default Value: false

limit
integer | null

Applied row limit.

Example:

1000
offset
integer | null

Applied row offset.

Example:

0
organization_id
array<string> | null

Organization IDs to include within the authenticated customer.

service_account_id
array<string> | null

Service account IDs to include.

service_tier
array<string> | null

Service tiers to include.

start
date-time* required

Inclusive start of the queried interval.

Example:

2026-08-01T00:00:00Z
time_bucket
"second" | "1min" | "5min" | "15min" | "30min" | "hour" | "4hours" | "day" | "week" | "month"

Time interval used to bucket grouped rows.

Example:

day
untracked
boolean | null

Applied attribution filter.

Example:

false
usage_type
array<"usage" | "codestral" | "document_library" | "document_library_api" | "libraries_pages" | "libraries_tokens" | "libraries_audio" | "chat" | "rlhf" | "ocr" | "audio_seconds" | "audio_characters" | "audio_agents" | "connectors" | "workflow_executions" | "skill_activations" | "managed_index_storage_bytes" | "managed_index_written_bytes" | "managed_index_searches" | "vibe" | "vibe_connectors" | "vibe_ocr" | "vibe_audio_seconds" | "vibe_audio_characters"> | null

Usage event types to include.

user_id
array<string> | null

User IDs to include.

workspace_ids
array<string | null> | null

Workspace IDs to include. Use null to include usage without a workspace.

GET /v1/admin/spending-limits

List Spending Limits

List the organization's spending limits, each with its usage in the current window.

These limits count all usage, the included usage too. The monthly cap on what the organization is billed beyond its included usage is a different limit: /v1/admin/spend-limit.

Security

AdminApiKey
bearerhttp

Parameters

scope
"org" | "workspace" | "user_group" | "user" | "api_key"query

What the limit applies to: the organization, a workspace, a user group, a user or an API key.

subject_id
string | nullquery

Needs a scope.

page
integerquery

The page to return.

page_size
integerquery

The most results on a page.

Responses

Successful Response

limits
array<AdminLimitOut>* required

The limits on this page.

AdminLimitOut
amount
integer | null* required

The limit, in currency. null for an exemption.

Example:

100
anchor
"calendar" | "start" | "first_use"* required

Where a limit's windows are counted from.

anchor_at
date-time | null* required

With anchor start: when windows start.

Example:

null
currency
"EUR" | "USD"* required
email_admins
boolean* required

Whether the admins get the limit's emails.

Example:

true
email_user
boolean* required

Whether the user gets the limit's emails.

Example:

false
group_kind
"pool" | "per_member"* required

User group limits only.

Example:

null
id
string* required

The limit's ID.

Example:

3fa85f64-5717-4562-b3fc-2c963f66afa6
period
"minute" | "hour" | "day" | "week" | "month" | "year" | "none"* required

The unit of a limit's window, in UTC: the window is period_count of them (six hours are hour×6, a quarter month×3).

period_count
integer* required

How many periods a window lasts.

Example:

1
product
"all" | "api" | "vibe_code"* required
resets_at
date-time | null* required

When the current window ends. null for a fixed amount, which never resets, and for windows from first use that aren't one subject's.

Example:

2026-12-01T00:00:00Z
scope
"org" | "workspace" | "user_group" | "user" | "api_key"* required
set_by_actor_metadata
map<string>* required

Who last saved the limit: their IDs.

set_by_actor_type
"HUMAN" | "API_KEY" | "ADMIN_API_KEY" | "SERVICE_ACCOUNT" | "OTHER"* required
starts_at
date-time* required

When the limit was saved: spend from before may not count toward it.

Example:

2026-11-19T10:00:00Z
subject_id
string | null* required

The workspace, user group, user or API key the limit applies to. Left out for the organization, and for the default every user (scope user), or every API key (scope api_key), without a limit of their own gets.

Example:

3fa85f64-5717-4562-b3fc-2c963f66afa6
updated_at
date-time* required

When the limit was last saved.

Example:

2026-11-19T10:00:00Z
used
number | null* required

Spent in the current window, in currency. null when each user or key is counted on their own (the defaults, a group's allowance for each member) and for an exemption.

Example:

42.17
page
integer* required

The page returned.

Example:

1
page_size
integer* required

The most limits on a page.

Example:

25
total
integer* required

How many limits match the request.

Example:

1

POST /v1/admin/spending-limits

Create Spending Limit

Create a spending limit. A 409 names the limit the subject already has on that product and window.

These limits count all usage, the included usage too. The monthly cap on what the organization is billed beyond its included usage is a different limit: /v1/admin/spend-limit.

Security

AdminApiKey
bearerhttp

Request Example

{
  "amount": null,
  "period": "minute",
  "scope": "org"
}

Request Body

amount
integer | null* required

The limit, a whole amount in the organization's currency. null exempts a user from the default and their groups' allowances, an API key from the default, or a group's members (per_member) from the default; an exemption is on all usage with period none.

Example:

100
anchor
"calendar" | "start" | "first_use"

Where a limit's windows are counted from.

anchor_at
date-time | null

With anchor start only: when the first window starts. Left out: when the limit is saved.

Example:

2026-12-01T00:00:00Z
email_admins
boolean | null

Whether the organization's admins (a workspace's admins, for a workspace limit) get an email at 90% and 100% of the limit. Left out: false for a user's limit and a group's allowance for each member, true for the others.

Example:

true
email_user
boolean | null

Whether the user gets an email at 90% and 100% of the limit. A user's limit and a group's allowance for each member only. Left out: true for those.

Example:

true
group_kind
"pool" | "per_member"

User group limits only.

Example:

null
period
"minute" | "hour" | "day" | "week" | "month" | "year" | "none"* required

The unit of a limit's window, in UTC: the window is period_count of them (six hours are hour×6, a quarter month×3).

period_count
integer | null

How many periods a window lasts, for example 6 with hour for six hours. Left out: 1. A fixed amount takes none.

Example:

1
product
"all" | "api" | "vibe_code"
scope
"org" | "workspace" | "user_group" | "user" | "api_key"* required
subject_id
string | null

The workspace, user group, user or API key the limit applies to. Left out for the organization, and for the default every user (scope user), or every API key (scope api_key), without a limit of their own gets.

Example:

3fa85f64-5717-4562-b3fc-2c963f66afa6

Server-Side Events

Successful Response

amount
integer | null* required

The limit, in currency. null for an exemption.

Example:

100
anchor
"calendar" | "start" | "first_use"* required

Where a limit's windows are counted from.

anchor_at
date-time | null* required

With anchor start: when windows start.

Example:

null
currency
"EUR" | "USD"* required
email_admins
boolean* required

Whether the admins get the limit's emails.

Example:

true
email_user
boolean* required

Whether the user gets the limit's emails.

Example:

false
group_kind
"pool" | "per_member"* required

User group limits only.

Example:

null
id
string* required

The limit's ID.

Example:

3fa85f64-5717-4562-b3fc-2c963f66afa6
period
"minute" | "hour" | "day" | "week" | "month" | "year" | "none"* required

The unit of a limit's window, in UTC: the window is period_count of them (six hours are hour×6, a quarter month×3).

period_count
integer* required

How many periods a window lasts.

Example:

1
product
"all" | "api" | "vibe_code"* required
resets_at
date-time | null* required

When the current window ends. null for a fixed amount, which never resets, and for windows from first use that aren't one subject's.

Example:

2026-12-01T00:00:00Z
scope
"org" | "workspace" | "user_group" | "user" | "api_key"* required
set_by_actor_metadata
map<string>* required

Who last saved the limit: their IDs.

set_by_actor_type
"HUMAN" | "API_KEY" | "ADMIN_API_KEY" | "SERVICE_ACCOUNT" | "OTHER"* required
starts_at
date-time* required

When the limit was saved: spend from before may not count toward it.

Example:

2026-11-19T10:00:00Z
subject_id
string | null* required

The workspace, user group, user or API key the limit applies to. Left out for the organization, and for the default every user (scope user), or every API key (scope api_key), without a limit of their own gets.

Example:

3fa85f64-5717-4562-b3fc-2c963f66afa6
updated_at
date-time* required

When the limit was last saved.

Example:

2026-11-19T10:00:00Z
used
number | null* required

Spent in the current window, in currency. null when each user or key is counted on their own (the defaults, a group's allowance for each member) and for an exemption.

Example:

42.17

GET /v1/admin/spending-limits/applied

Get Applied Spending Limits

The spending limits that hold a user, as requests are checked against them, with the user's usage.

Security

AdminApiKey
bearerhttp

Parameters

user_id
stringquery* required

The user.

Responses

Successful Response

limits
array<AdminLimitOut>* required

The limits on this page.

AdminLimitOut
amount
integer | null* required

The limit, in currency. null for an exemption.

Example:

100
anchor
"calendar" | "start" | "first_use"* required

Where a limit's windows are counted from.

anchor_at
date-time | null* required

With anchor start: when windows start.

Example:

null
currency
"EUR" | "USD"* required
email_admins
boolean* required

Whether the admins get the limit's emails.

Example:

true
email_user
boolean* required

Whether the user gets the limit's emails.

Example:

false
group_kind
"pool" | "per_member"* required

User group limits only.

Example:

null
id
string* required

The limit's ID.

Example:

3fa85f64-5717-4562-b3fc-2c963f66afa6
period
"minute" | "hour" | "day" | "week" | "month" | "year" | "none"* required

The unit of a limit's window, in UTC: the window is period_count of them (six hours are hour×6, a quarter month×3).

period_count
integer* required

How many periods a window lasts.

Example:

1
product
"all" | "api" | "vibe_code"* required
resets_at
date-time | null* required

When the current window ends. null for a fixed amount, which never resets, and for windows from first use that aren't one subject's.

Example:

2026-12-01T00:00:00Z
scope
"org" | "workspace" | "user_group" | "user" | "api_key"* required
set_by_actor_metadata
map<string>* required

Who last saved the limit: their IDs.

set_by_actor_type
"HUMAN" | "API_KEY" | "ADMIN_API_KEY" | "SERVICE_ACCOUNT" | "OTHER"* required
starts_at
date-time* required

When the limit was saved: spend from before may not count toward it.

Example:

2026-11-19T10:00:00Z
subject_id
string | null* required

The workspace, user group, user or API key the limit applies to. Left out for the organization, and for the default every user (scope user), or every API key (scope api_key), without a limit of their own gets.

Example:

3fa85f64-5717-4562-b3fc-2c963f66afa6
updated_at
date-time* required

When the limit was last saved.

Example:

2026-11-19T10:00:00Z
used
number | null* required

Spent in the current window, in currency. null when each user or key is counted on their own (the defaults, a group's allowance for each member) and for an exemption.

Example:

42.17

GET /v1/admin/spending-limits/{limit_id}

Get Spending Limit

Get a spending limit with its usage in the current window.

Security

AdminApiKey
bearerhttp

Parameters

limit_id
stringpath* required

Responses

Successful Response

amount
integer | null* required

The limit, in currency. null for an exemption.

Example:

100
anchor
"calendar" | "start" | "first_use"* required

Where a limit's windows are counted from.

anchor_at
date-time | null* required

With anchor start: when windows start.

Example:

null
currency
"EUR" | "USD"* required
email_admins
boolean* required

Whether the admins get the limit's emails.

Example:

true
email_user
boolean* required

Whether the user gets the limit's emails.

Example:

false
group_kind
"pool" | "per_member"* required

User group limits only.

Example:

null
id
string* required

The limit's ID.

Example:

3fa85f64-5717-4562-b3fc-2c963f66afa6
period
"minute" | "hour" | "day" | "week" | "month" | "year" | "none"* required

The unit of a limit's window, in UTC: the window is period_count of them (six hours are hour×6, a quarter month×3).

period_count
integer* required

How many periods a window lasts.

Example:

1
product
"all" | "api" | "vibe_code"* required
resets_at
date-time | null* required

When the current window ends. null for a fixed amount, which never resets, and for windows from first use that aren't one subject's.

Example:

2026-12-01T00:00:00Z
scope
"org" | "workspace" | "user_group" | "user" | "api_key"* required
set_by_actor_metadata
map<string>* required

Who last saved the limit: their IDs.

set_by_actor_type
"HUMAN" | "API_KEY" | "ADMIN_API_KEY" | "SERVICE_ACCOUNT" | "OTHER"* required
starts_at
date-time* required

When the limit was saved: spend from before may not count toward it.

Example:

2026-11-19T10:00:00Z
subject_id
string | null* required

The workspace, user group, user or API key the limit applies to. Left out for the organization, and for the default every user (scope user), or every API key (scope api_key), without a limit of their own gets.

Example:

3fa85f64-5717-4562-b3fc-2c963f66afa6
updated_at
date-time* required

When the limit was last saved.

Example:

2026-11-19T10:00:00Z
used
number | null* required

Spent in the current window, in currency. null when each user or key is counted on their own (the defaults, a group's allowance for each member) and for an exemption.

Example:

42.17

DELETE /v1/admin/spending-limits/{limit_id}

Delete Spending Limit

Delete a spending limit.

Security

AdminApiKey
bearerhttp

Parameters

limit_id
stringpath* required

PATCH /v1/admin/spending-limits/{limit_id}

Update Spending Limit

Change a spending limit's amount, or who gets its emails. To change its window, delete it and create another.

Security

AdminApiKey
bearerhttp

Parameters

limit_id
stringpath* required

Request Example

{}

Request Body

amount
integer | null

The new limit, a whole amount in the limit's currency. Left out: unchanged. An exemption has no amount to change: delete it, then create a limit.

Example:

200
email_admins
boolean | null

Left out: unchanged.

Example:

true
email_user
boolean | null

Left out: unchanged.

Example:

false

Responses

Successful Response

amount
integer | null* required

The limit, in currency. null for an exemption.

Example:

100
anchor
"calendar" | "start" | "first_use"* required

Where a limit's windows are counted from.

anchor_at
date-time | null* required

With anchor start: when windows start.

Example:

null
currency
"EUR" | "USD"* required
email_admins
boolean* required

Whether the admins get the limit's emails.

Example:

true
email_user
boolean* required

Whether the user gets the limit's emails.

Example:

false
group_kind
"pool" | "per_member"* required

User group limits only.

Example:

null
id
string* required

The limit's ID.

Example:

3fa85f64-5717-4562-b3fc-2c963f66afa6
period
"minute" | "hour" | "day" | "week" | "month" | "year" | "none"* required

The unit of a limit's window, in UTC: the window is period_count of them (six hours are hour×6, a quarter month×3).

period_count
integer* required

How many periods a window lasts.

Example:

1
product
"all" | "api" | "vibe_code"* required
resets_at
date-time | null* required

When the current window ends. null for a fixed amount, which never resets, and for windows from first use that aren't one subject's.

Example:

2026-12-01T00:00:00Z
scope
"org" | "workspace" | "user_group" | "user" | "api_key"* required
set_by_actor_metadata
map<string>* required

Who last saved the limit: their IDs.

set_by_actor_type
"HUMAN" | "API_KEY" | "ADMIN_API_KEY" | "SERVICE_ACCOUNT" | "OTHER"* required
starts_at
date-time* required

When the limit was saved: spend from before may not count toward it.

Example:

2026-11-19T10:00:00Z
subject_id
string | null* required

The workspace, user group, user or API key the limit applies to. Left out for the organization, and for the default every user (scope user), or every API key (scope api_key), without a limit of their own gets.

Example:

3fa85f64-5717-4562-b3fc-2c963f66afa6
updated_at
date-time* required

When the limit was last saved.

Example:

2026-11-19T10:00:00Z
used
number | null* required

Spent in the current window, in currency. null when each user or key is counted on their own (the defaults, a group's allowance for each member) and for an exemption.

Example:

42.17

GET /v1/admin/spending-limits/{limit_id}/api-keys

Get Spending Limit Api Keys

Each API key's usage of the default every API key gets, largest first.

Security

AdminApiKey
bearerhttp

Parameters

limit_id
stringpath* required
api_key_id
array<string> | nullquery

Only these API keys.

page
integerquery

The page to return.

page_size
integerquery

The most results on a page.

Responses

Successful Response

api_keys
array<AdminApiKeyUsageOut>* required

This page, largest spend first.

AdminApiKeyUsageOut
api_key_id
string* required

The API key.

Example:

3fa85f64-5717-4562-b3fc-2c963f66afa6
held_by
AdminHeldByOut | null* required

For the default: the limit that holds this user or key instead of it, when one does.

Example:

null
AdminHeldByOut

For the default: the limit that holds this user or key instead of it, when one does.

Example:

null
amount
integer | null* required

null for an exemption.

Example:

500
limit_id
string* required

The limit that holds the user or key instead.

Example:

3fa85f64-5717-4562-b3fc-2c963f66afa6
scope
"org" | "workspace" | "user_group" | "user" | "api_key"* required
used
number | null* required

What it counts for the user or key in its window, in its currency.

Example:

12.5
products
array<string>* required

The products used counts.

resets_at
date-time | null* required

When this window ends, for windows from first use.

Example:

null
used
number* required

Spent in the current window, in the limit's currency.

Example:

12.5
page
integer* required

The page returned.

Example:

1
page_size
integer* required

The most API keys on a page.

Example:

25
total
integer* required

How many API keys spent in the window.

Example:

1

GET /v1/admin/spending-limits/{limit_id}/users

Get Spending Limit Users

Each user's usage of the default every user gets, or of a group's allowance for each member, largest first.

Security

AdminApiKey
bearerhttp

Parameters

limit_id
stringpath* required
user_id
array<string> | nullquery

Only these users.

page
integerquery

The page to return.

page_size
integerquery

The most results on a page.

Responses

Successful Response

page
integer* required

The page returned.

Example:

1
page_size
integer* required

The most users on a page.

Example:

25
total
integer* required

How many users spent in the window.

Example:

1
users
array<AdminUserUsageOut>* required

This page, largest spend first.

AdminUserUsageOut
held_by
AdminHeldByOut | null* required

For the default: the limit that holds this user or key instead of it, when one does.

Example:

null
AdminHeldByOut

For the default: the limit that holds this user or key instead of it, when one does.

Example:

null
amount
integer | null* required

null for an exemption.

Example:

500
limit_id
string* required

The limit that holds the user or key instead.

Example:

3fa85f64-5717-4562-b3fc-2c963f66afa6
scope
"org" | "workspace" | "user_group" | "user" | "api_key"* required
used
number | null* required

What it counts for the user or key in its window, in its currency.

Example:

12.5
products
array<string>* required

The products used counts.

resets_at
date-time | null* required

When this window ends, for windows from first use.

Example:

null
used
number* required

Spent in the current window, in the limit's currency.

Example:

12.5
user_id
string* required

The user.

Example:

3fa85f64-5717-4562-b3fc-2c963f66afa6

GET /v1/admin/rate-limit

Get Rate Limits

Get Rate Limits

Security

AdminApiKey
bearerhttp

Responses

OK

requests_per_second
integer* required

Maximum API requests allowed per second.

tokens_limits_by_model
map<TokenLimitsByModel>* required

Token limits for each model.

TokenLimitsByModel
tokens_per_minute
integer* required

Maximum tokens allowed per minute.

tokens_per_month
integer* required

Maximum tokens allowed per month.

GET /v1/admin/spend-limit

Get Spend Limits

Get the organization's monthly cap on what it is billed beyond its included usage, with this month's usage.

The spending limits on all usage (organization, workspace, user group, user, API key) are at /v1/admin/spending-limits.

Security

AdminApiKey
bearerhttp

Responses

OK

limits
LimitsContext* required
LimitsContext
completion
UsageLimits* required
UsageLimits
monthly_limit_reached
boolean* required

Whether the monthly usage limit has been reached.

no_monthly_limit
boolean

Whether no monthly usage limit is configured.

Default Value: false

total_usage
number | null

Total current usage counted against the limit.

usage
number | null

Current usage counted against the limit.

usage_limit
number | null

Current usage limit.

vibe_usage
number | null

Current Vibe usage counted against the limit.

currency
string* required

Currency used for usage and limit amounts.

Example:

USD
last_payment_failure
boolean* required

Whether the latest payment attempt failed.

last_payment_failure_protection
boolean | null* required

Whether payment failure protection is enabled.

POST /v1/admin/spend-limit

Update Spend Limits

Set or remove the organization's monthly cap on what it is billed beyond its included usage.

The spending limits on all usage (organization, workspace, user group, user, API key) are at /v1/admin/spending-limits.

Security

AdminApiKey
bearerhttp

Request Example

{
  "amount": 87
}

Request Body

amount
integer* required

The monthly cap on what the organization is billed beyond its included usage.

no_monthly_limit
boolean

Whether to remove the monthly cap.

Default Value: false

Responses

OK

limits
LimitsContext* required
LimitsContext
completion
UsageLimits* required
UsageLimits
monthly_limit_reached
boolean* required

Whether the monthly usage limit has been reached.

no_monthly_limit
boolean

Whether no monthly usage limit is configured.

Default Value: false

total_usage
number | null

Total current usage counted against the limit.

usage
number | null

Current usage counted against the limit.

usage_limit
number | null

Current usage limit.

vibe_usage
number | null

Current Vibe usage counted against the limit.

currency
string* required

Currency used for usage and limit amounts.

Example:

USD
last_payment_failure
boolean* required

Whether the latest payment attempt failed.

last_payment_failure_protection
boolean | null* required

Whether payment failure protection is enabled.

GET /v1/admin/usage

Monthly Usage and Pricing

Return the organization's usage for a calendar month in a fixed, product-oriented format.

The response includes the applicable price catalog and currency. For custom time ranges, filters, grouping, and pagination, use POST /v1/admin/usage/query.

Security

AdminApiKey
bearerhttp

Parameters

month
string | nullquery

Month to return usage for.

year
string | nullquery

Year to return usage for.

workspace_id
string | nullquery

Workspace ID to filter results.

api_zone
"global" | "us" | "eu"query

Regional inference zone to filter results.

Responses

OK

BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* required

Usage data grouped by model.

audio_agents
BasicModelUsageDataJSON* required
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* required

Usage data grouped by model.

audio_characters
BasicModelUsageDataJSON* required
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* required

Usage data grouped by model.

BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* required

Usage data grouped by model.

completion
BasicModelUsageDataJSON* required
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* required

Usage data grouped by model.

connectors
BasicModelUsageDataJSON* required
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* required

Usage data grouped by model.

currency
string | null* required

Currency used for usage prices.

currency_symbol
string | null* required

Currency symbol used for usage prices.

date
date-time* required

Reference date for the usage period.

end_date
date-time* required

End of the usage period.

fine_tuning
FineTuningDataJSON* required
FineTuningDataJSON
storage
map<integer>* required

Fine-tuning storage usage.

training
map<map<array<map<any>>>>* required

Fine-tuning training usage.

libraries_api
LibrariesAPIUsageDataJSON* required
LibrariesAPIUsageDataJSON
audio_seconds
BasicModelUsageDataJSON* required
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* required

Usage data grouped by model.

BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* required

Usage data grouped by model.

tokens
BasicModelUsageDataJSON* required
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* required

Usage data grouped by model.

next_month
string | null* required

Next month in the usage report.

BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* required

Usage data grouped by model.

previous_month
string | null* required

Previous month in the usage report.

prices
array<PriceData> | null* required

Prices used to calculate usage amounts.

PriceData
api_zone
"global" | "us" | "eu"* required
billing_group
string* required

Billing metric group this price applies to.

billing_metric
string* required

Billing metric this price applies to.

event_type
"api_tokens" | "api_pages" | "api_audio_seconds" | "api_audio_characters" | "api_connectors" | "api_libraries_tokens" | "api_libraries_pages" | "api_libraries_audio" | "api_managed_index_storage_bytes" | "api_managed_index_written_bytes" | "api_managed_index_searches" | "deployment_tokens" | "gpu_hour" | "reserved_instance" | "vibe_tokens" | "vibe_connectors" | "vibe_pages" | "vibe_audio_seconds" | "vibe_audio_characters"* required

Billing event type for the price.

price
number | string* required

Unit price for the billing metric.

service_tier
"standard" | "priority"* required

The service tier a request is resolved to and routed on.

start_date
date-time* required

Start of the usage period.

vibe_code
VibeCodeUsageDataJSON* required
VibeCodeUsageDataJSON
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* required

Usage data grouped by model.

audio_characters
BasicModelUsageDataJSON* required
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* required

Usage data grouped by model.

completion
BasicModelUsageDataJSON* required
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* required

Usage data grouped by model.

connectors
BasicModelUsageDataJSON* required
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* required

Usage data grouped by model.

BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* required

Usage data grouped by model.

vibe_usage
number* required

Legacy Vibe usage field. Always 0; use the Vibe usage API instead.