- API Reference
- endpoint
- beta
- admin
Beta Admin Billing
Beta Admin Billing
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
bearerhttpRequest Example
{
"end": "2026-09-01T00:00:00Z",
"start": "2026-08-01T00:00:00Z"
}
Request Body
api_key_id
array<string> | nullAPI key IDs to include.
api_zone
array<string> | nullInference regions to include.
billing_display_name
array<string> | nullCustomer-facing billing metric names to include.
billing_group
array<string> | nullBilling metric components to include.
billing_metric
array<string> | nullBilling metric identifiers to include.
end
date-time* requiredExclusive end of the usage interval.
Example:
2026-09-01T00:00:00Z
filters
array<AdminUsageQueryFilter> | nullAdditional 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"* requiredUsage dimension to filter.
Example:
billing_metric
operator
"is" | "is_not"* requiredWhether rows must match or must not match the supplied values.
Example:
is
values
array<string | null>Min Items: 1* requiredAccepted 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"> | nullDimensions used to group the returned usage rows.
include_aggregates
booleanReturn aggregates computed over the complete filtered result set.
Example:
true
Default Value: false
include_nb_api_calls
booleanInclude the number of distinct API calls in grouped rows and aggregates.
Example:
true
Default Value: false
limit
integer | nullMaximum number of grouped rows to return.
Example:
1000
offset
integer | nullNumber of grouped rows to skip.
Example:
0
organization_id
array<string> | nullOrganization IDs to include within the authenticated customer.
service_account_id
array<string> | nullService account IDs to include.
service_tier
array<string> | nullService tiers to include.
start
date-time* requiredInclusive 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 | nullFilter 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"> | nullUsage event types to include.
user_id
array<string> | nullUser IDs to include.
workspace_ids
array<string | null> | nullWorkspace IDs to include. Use null to include usage without a workspace.
Responses
Successful Response
aggregates
UsageQueryAggregatesOUT | nullAggregates over the complete filtered result set when requested.
UsageQueryAggregatesOUT
Aggregates over the complete filtered result set when requested.
customer_count
integer* requiredNumber of matching customers.
Example:
1
total_api_calls
integer* requiredTotal number of distinct API calls.
Example:
10
total_count
integer* requiredTotal number of matching usage records.
Example:
12
total_value
number* requiredTotal usage value across all matching rows.
Example:
1500
usage_type_count
integer* requiredNumber of matching usage types.
Example:
2
Grouped usage rows.
UsageQueryRowOUT
api_key_id
string | nullAPI key ID.
Example:
api-key-id
api_zone
string | nullInference region.
Example:
us
billing_display_name
string | nullCustomer-facing billing metric name.
Example:
mistral-large-latest
billing_group
string | nullBilling metric component.
Example:
input
billing_metric
string | nullBilling metric identifier.
Example:
mistral-large
call_source
string | nullProduct source of the call.
Example:
api
call_type
string | nullType of call within its source.
Example:
completion
count
integer | nullNumber of usage records in this row.
Example:
12
customer_id
string | nullCustomer ID for this row.
Example:
customer-id
customer_tier
string | nullCustomer tier.
Example:
enterprise
nb_api_calls
integer | nullNumber of distinct API calls.
Example:
10
organization_id
string | nullOrganization ID.
Example:
organization-id
resource_id
string | nullID of the resource the usage is attributed to, such as a workflow ID.
Example:
0199a6f5-7c3e-7b1a-9d2e-4f5a6b7c8d9e
resource_version
string | nullVersion of the resource the usage is attributed to, when the resource is versioned.
Example:
1
service_account_id
string | nullService account ID.
Example:
service-account-id
service_tier
string | nullService tier.
Example:
standard
time_bucket
date-time | nullStart of the UTC time bucket, expressed using the request start timestamp's UTC offset.
Example:
2026-08-01T00:00:00Z
timestamp
date-time | nullTimestamp of an unbucketed usage row, expressed using the request start timestamp's UTC offset.
Example:
2026-08-01T12:00:00Z
untracked
boolean | nullWhether attribution was unavailable.
Example:
false
usage_type
string | nullUsage event type.
Example:
usage
user_agent
string | nullHarness identified from the request User-Agent header.
Example:
claude_code
user_id
string | nullUser ID.
Example:
user-id
value
integer | nullTotal usage value for this row.
Example:
1500
workspace_id
string | nullWorkspace ID.
Example:
workspace-id
UsageQueryMetadataOUT
has_more
boolean* requiredWhether another page of grouped rows is available.
Example:
false
UsageQueryParamsOUT
api_key_id
array<string> | nullAPI key IDs to include.
api_zone
array<string> | nullInference regions to include.
billing_display_name
array<string> | nullCustomer-facing billing metric names to include.
billing_group
array<string> | nullBilling metric components to include.
billing_metric
array<string> | nullBilling metric identifiers to include.
customer_id
string | nullCustomer scope derived from the authenticated Admin API key.
Example:
69bc23d6-4db3-47ad-9cce-bda1b24509f2
end
date-time* requiredExclusive end of the queried interval.
Example:
2026-09-01T00:00:00Z
filters
array<AdminUsageQueryFilter> | nullAdditional 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"* requiredUsage dimension to filter.
Example:
billing_metric
operator
"is" | "is_not"* requiredWhether rows must match or must not match the supplied values.
Example:
is
values
array<string | null>Min Items: 1* requiredAccepted 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"> | nullDimensions used to group the returned usage rows.
include_nb_api_calls
booleanWhether distinct API-call counts were requested.
Example:
true
Default Value: false
limit
integer | nullApplied row limit.
Example:
1000
offset
integer | nullApplied row offset.
Example:
0
organization_id
array<string> | nullOrganization IDs to include within the authenticated customer.
service_account_id
array<string> | nullService account IDs to include.
service_tier
array<string> | nullService tiers to include.
start
date-time* requiredInclusive 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 | nullApplied 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"> | nullUsage event types to include.
user_id
array<string> | nullUser IDs to include.
workspace_ids
array<string | null> | nullWorkspace 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
bearerhttpParameters
scope
"org" | "workspace" | "user_group" | "user" | "api_key"queryWhat the limit applies to: the organization, a workspace, a user group, a user or an API key.
subject_id
string | nullqueryNeeds a scope.
page
integerqueryThe page to return.
page_size
integerqueryThe most results on a page.
Responses
Successful Response
The limits on this page.
AdminLimitOut
amount
integer | null* requiredThe limit, in currency. null for an exemption.
Example:
100
anchor
"calendar" | "start" | "first_use"* requiredWhere a limit's windows are counted from.
anchor_at
date-time | null* requiredWith anchor start: when windows start.
Example:
null
currency
"EUR" | "USD"* requiredemail_admins
boolean* requiredWhether the admins get the limit's emails.
Example:
true
email_user
boolean* requiredWhether the user gets the limit's emails.
Example:
false
group_kind
"pool" | "per_member"* requiredUser group limits only.
Example:
null
id
string* requiredThe limit's ID.
Example:
3fa85f64-5717-4562-b3fc-2c963f66afa6
period
"minute" | "hour" | "day" | "week" | "month" | "year" | "none"* requiredThe 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* requiredHow many periods a window lasts.
Example:
1
product
"all" | "api" | "vibe_code"* requiredresets_at
date-time | null* requiredWhen 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"* requiredset_by_actor_metadata
map<string>* requiredWho last saved the limit: their IDs.
set_by_actor_type
"HUMAN" | "API_KEY" | "ADMIN_API_KEY" | "SERVICE_ACCOUNT" | "OTHER"* requiredstarts_at
date-time* requiredWhen the limit was saved: spend from before may not count toward it.
Example:
2026-11-19T10:00:00Z
subject_id
string | null* requiredThe 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* requiredWhen the limit was last saved.
Example:
2026-11-19T10:00:00Z
used
number | null* requiredSpent 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* requiredThe page returned.
Example:
1
page_size
integer* requiredThe most limits on a page.
Example:
25
total
integer* requiredHow 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
bearerhttpRequest Example
{
"amount": null,
"period": "minute",
"scope": "org"
}
Request Body
amount
integer | null* requiredThe 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 | nullWith anchor start only: when the first window starts. Left out: when the limit is saved.
Example:
2026-12-01T00:00:00Z
email_admins
boolean | nullWhether 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 | nullWhether 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"* requiredThe 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 | nullHow 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"* requiredsubject_id
string | nullThe 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* requiredThe limit, in currency. null for an exemption.
Example:
100
anchor
"calendar" | "start" | "first_use"* requiredWhere a limit's windows are counted from.
anchor_at
date-time | null* requiredWith anchor start: when windows start.
Example:
null
currency
"EUR" | "USD"* requiredemail_admins
boolean* requiredWhether the admins get the limit's emails.
Example:
true
email_user
boolean* requiredWhether the user gets the limit's emails.
Example:
false
group_kind
"pool" | "per_member"* requiredUser group limits only.
Example:
null
id
string* requiredThe limit's ID.
Example:
3fa85f64-5717-4562-b3fc-2c963f66afa6
period
"minute" | "hour" | "day" | "week" | "month" | "year" | "none"* requiredThe 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* requiredHow many periods a window lasts.
Example:
1
product
"all" | "api" | "vibe_code"* requiredresets_at
date-time | null* requiredWhen 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"* requiredset_by_actor_metadata
map<string>* requiredWho last saved the limit: their IDs.
set_by_actor_type
"HUMAN" | "API_KEY" | "ADMIN_API_KEY" | "SERVICE_ACCOUNT" | "OTHER"* requiredstarts_at
date-time* requiredWhen the limit was saved: spend from before may not count toward it.
Example:
2026-11-19T10:00:00Z
subject_id
string | null* requiredThe 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* requiredWhen the limit was last saved.
Example:
2026-11-19T10:00:00Z
used
number | null* requiredSpent 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
bearerhttpParameters
user_id
stringquery* requiredThe user.
Responses
Successful Response
The limits on this page.
AdminLimitOut
amount
integer | null* requiredThe limit, in currency. null for an exemption.
Example:
100
anchor
"calendar" | "start" | "first_use"* requiredWhere a limit's windows are counted from.
anchor_at
date-time | null* requiredWith anchor start: when windows start.
Example:
null
currency
"EUR" | "USD"* requiredemail_admins
boolean* requiredWhether the admins get the limit's emails.
Example:
true
email_user
boolean* requiredWhether the user gets the limit's emails.
Example:
false
group_kind
"pool" | "per_member"* requiredUser group limits only.
Example:
null
id
string* requiredThe limit's ID.
Example:
3fa85f64-5717-4562-b3fc-2c963f66afa6
period
"minute" | "hour" | "day" | "week" | "month" | "year" | "none"* requiredThe 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* requiredHow many periods a window lasts.
Example:
1
product
"all" | "api" | "vibe_code"* requiredresets_at
date-time | null* requiredWhen 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"* requiredset_by_actor_metadata
map<string>* requiredWho last saved the limit: their IDs.
set_by_actor_type
"HUMAN" | "API_KEY" | "ADMIN_API_KEY" | "SERVICE_ACCOUNT" | "OTHER"* requiredstarts_at
date-time* requiredWhen the limit was saved: spend from before may not count toward it.
Example:
2026-11-19T10:00:00Z
subject_id
string | null* requiredThe 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* requiredWhen the limit was last saved.
Example:
2026-11-19T10:00:00Z
used
number | null* requiredSpent 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
bearerhttpParameters
limit_id
stringpath* requiredResponses
Successful Response
amount
integer | null* requiredThe limit, in currency. null for an exemption.
Example:
100
anchor
"calendar" | "start" | "first_use"* requiredWhere a limit's windows are counted from.
anchor_at
date-time | null* requiredWith anchor start: when windows start.
Example:
null
currency
"EUR" | "USD"* requiredemail_admins
boolean* requiredWhether the admins get the limit's emails.
Example:
true
email_user
boolean* requiredWhether the user gets the limit's emails.
Example:
false
group_kind
"pool" | "per_member"* requiredUser group limits only.
Example:
null
id
string* requiredThe limit's ID.
Example:
3fa85f64-5717-4562-b3fc-2c963f66afa6
period
"minute" | "hour" | "day" | "week" | "month" | "year" | "none"* requiredThe 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* requiredHow many periods a window lasts.
Example:
1
product
"all" | "api" | "vibe_code"* requiredresets_at
date-time | null* requiredWhen 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"* requiredset_by_actor_metadata
map<string>* requiredWho last saved the limit: their IDs.
set_by_actor_type
"HUMAN" | "API_KEY" | "ADMIN_API_KEY" | "SERVICE_ACCOUNT" | "OTHER"* requiredstarts_at
date-time* requiredWhen the limit was saved: spend from before may not count toward it.
Example:
2026-11-19T10:00:00Z
subject_id
string | null* requiredThe 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* requiredWhen the limit was last saved.
Example:
2026-11-19T10:00:00Z
used
number | null* requiredSpent 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
bearerhttpParameters
limit_id
stringpath* requiredPATCH /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
bearerhttpParameters
limit_id
stringpath* requiredRequest Example
{}
Request Body
amount
integer | nullThe 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 | nullLeft out: unchanged.
Example:
true
email_user
boolean | nullLeft out: unchanged.
Example:
false
Responses
Successful Response
amount
integer | null* requiredThe limit, in currency. null for an exemption.
Example:
100
anchor
"calendar" | "start" | "first_use"* requiredWhere a limit's windows are counted from.
anchor_at
date-time | null* requiredWith anchor start: when windows start.
Example:
null
currency
"EUR" | "USD"* requiredemail_admins
boolean* requiredWhether the admins get the limit's emails.
Example:
true
email_user
boolean* requiredWhether the user gets the limit's emails.
Example:
false
group_kind
"pool" | "per_member"* requiredUser group limits only.
Example:
null
id
string* requiredThe limit's ID.
Example:
3fa85f64-5717-4562-b3fc-2c963f66afa6
period
"minute" | "hour" | "day" | "week" | "month" | "year" | "none"* requiredThe 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* requiredHow many periods a window lasts.
Example:
1
product
"all" | "api" | "vibe_code"* requiredresets_at
date-time | null* requiredWhen 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"* requiredset_by_actor_metadata
map<string>* requiredWho last saved the limit: their IDs.
set_by_actor_type
"HUMAN" | "API_KEY" | "ADMIN_API_KEY" | "SERVICE_ACCOUNT" | "OTHER"* requiredstarts_at
date-time* requiredWhen the limit was saved: spend from before may not count toward it.
Example:
2026-11-19T10:00:00Z
subject_id
string | null* requiredThe 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* requiredWhen the limit was last saved.
Example:
2026-11-19T10:00:00Z
used
number | null* requiredSpent 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
bearerhttpParameters
limit_id
stringpath* requiredapi_key_id
array<string> | nullqueryOnly these API keys.
page
integerqueryThe page to return.
page_size
integerqueryThe most results on a page.
Responses
Successful Response
This page, largest spend first.
AdminApiKeyUsageOut
api_key_id
string* requiredThe API key.
Example:
3fa85f64-5717-4562-b3fc-2c963f66afa6
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* requirednull for an exemption.
Example:
500
limit_id
string* requiredThe limit that holds the user or key instead.
Example:
3fa85f64-5717-4562-b3fc-2c963f66afa6
scope
"org" | "workspace" | "user_group" | "user" | "api_key"* requiredused
number | null* requiredWhat it counts for the user or key in its window, in its currency.
Example:
12.5
products
array<string>* requiredThe products used counts.
resets_at
date-time | null* requiredWhen this window ends, for windows from first use.
Example:
null
used
number* requiredSpent in the current window, in the limit's currency.
Example:
12.5
page
integer* requiredThe page returned.
Example:
1
page_size
integer* requiredThe most API keys on a page.
Example:
25
total
integer* requiredHow 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
bearerhttpParameters
limit_id
stringpath* requireduser_id
array<string> | nullqueryOnly these users.
page
integerqueryThe page to return.
page_size
integerqueryThe most results on a page.
Responses
Successful Response
page
integer* requiredThe page returned.
Example:
1
page_size
integer* requiredThe most users on a page.
Example:
25
total
integer* requiredHow many users spent in the window.
Example:
1
This page, largest spend first.
AdminUserUsageOut
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* requirednull for an exemption.
Example:
500
limit_id
string* requiredThe limit that holds the user or key instead.
Example:
3fa85f64-5717-4562-b3fc-2c963f66afa6
scope
"org" | "workspace" | "user_group" | "user" | "api_key"* requiredused
number | null* requiredWhat it counts for the user or key in its window, in its currency.
Example:
12.5
products
array<string>* requiredThe products used counts.
resets_at
date-time | null* requiredWhen this window ends, for windows from first use.
Example:
null
used
number* requiredSpent in the current window, in the limit's currency.
Example:
12.5
user_id
string* requiredThe user.
Example:
3fa85f64-5717-4562-b3fc-2c963f66afa6
GET /v1/admin/rate-limit
Get Rate Limits
Get Rate Limits
Security
AdminApiKey
bearerhttpResponses
OK
requests_per_second
integer* requiredMaximum API requests allowed per second.
Token limits for each model.
TokenLimitsByModel
tokens_per_minute
integer* requiredMaximum tokens allowed per minute.
tokens_per_month
integer* requiredMaximum 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
bearerhttpResponses
OK
LimitsContext
UsageLimits
monthly_limit_reached
boolean* requiredWhether the monthly usage limit has been reached.
no_monthly_limit
booleanWhether no monthly usage limit is configured.
Default Value: false
total_usage
number | nullTotal current usage counted against the limit.
usage
number | nullCurrent usage counted against the limit.
usage_limit
number | nullCurrent usage limit.
vibe_usage
number | nullCurrent Vibe usage counted against the limit.
currency
string* requiredCurrency used for usage and limit amounts.
Example:
USD
last_payment_failure
boolean* requiredWhether the latest payment attempt failed.
last_payment_failure_protection
boolean | null* requiredWhether 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
bearerhttpRequest Example
{
"amount": 87
}
Request Body
amount
integer* requiredThe monthly cap on what the organization is billed beyond its included usage.
no_monthly_limit
booleanWhether to remove the monthly cap.
Default Value: false
Responses
OK
LimitsContext
UsageLimits
monthly_limit_reached
boolean* requiredWhether the monthly usage limit has been reached.
no_monthly_limit
booleanWhether no monthly usage limit is configured.
Default Value: false
total_usage
number | nullTotal current usage counted against the limit.
usage
number | nullCurrent usage counted against the limit.
usage_limit
number | nullCurrent usage limit.
vibe_usage
number | nullCurrent Vibe usage counted against the limit.
currency
string* requiredCurrency used for usage and limit amounts.
Example:
USD
last_payment_failure
boolean* requiredWhether the latest payment attempt failed.
last_payment_failure_protection
boolean | null* requiredWhether 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
bearerhttpParameters
month
string | nullqueryMonth to return usage for.
year
string | nullqueryYear to return usage for.
workspace_id
string | nullqueryWorkspace ID to filter results.
api_zone
"global" | "us" | "eu"queryRegional inference zone to filter results.
Responses
OK
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* requiredUsage data grouped by model.
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* requiredUsage data grouped by model.
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* requiredUsage data grouped by model.
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* requiredUsage data grouped by model.
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* requiredUsage data grouped by model.
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* requiredUsage data grouped by model.
currency
string | null* requiredCurrency used for usage prices.
currency_symbol
string | null* requiredCurrency symbol used for usage prices.
date
date-time* requiredReference date for the usage period.
end_date
date-time* requiredEnd of the usage period.
FineTuningDataJSON
storage
map<integer>* requiredFine-tuning storage usage.
training
map<map<array<map<any>>>>* requiredFine-tuning training usage.
LibrariesAPIUsageDataJSON
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* requiredUsage data grouped by model.
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* requiredUsage data grouped by model.
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* requiredUsage data grouped by model.
next_month
string | null* requiredNext month in the usage report.
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* requiredUsage data grouped by model.
previous_month
string | null* requiredPrevious month in the usage report.
Prices used to calculate usage amounts.
PriceData
api_zone
"global" | "us" | "eu"* requiredbilling_group
string* requiredBilling metric group this price applies to.
billing_metric
string* requiredBilling 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"* requiredBilling event type for the price.
price
number | string* requiredUnit price for the billing metric.
service_tier
"standard" | "priority"* requiredThe service tier a request is resolved to and routed on.
start_date
date-time* requiredStart of the usage period.
VibeCodeUsageDataJSON
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* requiredUsage data grouped by model.
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* requiredUsage data grouped by model.
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* requiredUsage data grouped by model.
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* requiredUsage data grouped by model.
BasicModelUsageDataJSON
models
map<map<array<map<any>>>>* requiredUsage data grouped by model.
vibe_usage
number* requiredLegacy Vibe usage field. Always 0; use the Vibe usage API instead.