Skip to main content
GET
cURL
Your organization’s token usage and cost over a time window, along with its credit balance, API keys and spend caps. Any API key in the organization can call it, and the report always covers the whole organization behind that key.

Time window

start and end take RFC 3339 timestamps with a time zone, such as 2026-11-01T00:00:00Z. Both are rounded down to the hour, so usage is reported in whole hours and the current hour appears once it ends.
  • With neither set, the report covers the last 7 days.
  • start can go back at most 90 days.
  • end cannot be in the future.
The usage.start and usage.end fields in the response show the window after defaults and rounding.

Buckets

bucket splits the window into day, week or month buckets, all in UTC. Weeks start on Monday and months start on the 1st. The first and last buckets are cut to the window, so a window from Wednesday to the following Wednesday returns two week buckets: Wednesday to Monday, then Monday to Wednesday. Every bucket in the window is returned, including buckets with no usage, which have an empty results list.

Grouping

group_by sets what each bucket’s results are split by:
Per-key usage is only available from December 2, 2026 onward. Usage before that date is not attributed to any key: with group_by=api_key or group_by=model,api_key, it appears under api_key_id: null. To see usage per key, set start to 2026-12-02T00:00:00Z or later.
api_key_id matches an entry in keys, so you can look up a key’s name. It is null for usage before December 2, 2026, and for usage from the Relace console. totals covers the whole window and is the same whatever bucket and group_by you choose.

Tokens and cost

  • input_tokens counts all input tokens, cached ones included. cached_input_tokens is the part served from the prefix cache.
  • Money fields are US dollars as decimal strings with 9 decimal places, such as "0.710000000". Parse them as decimals, not floats, to avoid rounding errors.
  • Each result is rounded down to 9 decimal places on its own, so totals.cost_usd can be slightly higher than the sum of the results shown, by less than $0.000000001 per result.

Credits, keys and spend caps

  • credits.remaining_usd is the prepaid credit balance. credits is null for accounts billed by invoice.
  • keys lists every API key in the organization, newest first, including revoked keys with their revoked_at time.
  • spend_caps lists the organization’s daily, weekly and monthly spend caps with the current period’s spend. capped_until is set while a cap is blocking requests.
This endpoint keeps working when the organization is out of credits or over a spend cap, so you can always check where you stand.

Rate limits

Usage calls have their own budget of 60 requests per minute per organization, shared by all of the organization’s keys. They do not count against your model request rate limit. Over the limit, you’ll receive a 429 with a Retry-After header. If the usage service is briefly unavailable, you’ll receive a 503 with a Retry-After header and can retry after that interval. A report is never returned partially.

Authorizations

Authorization
string
header
required

Relace API key Authorization header using the Bearer scheme.

Query Parameters

start
string<date-time>

Start of the window, as an RFC 3339 timestamp with a time zone. Rounded down to the hour. Must be within the last 90 days. Defaults to 7 days before end.

end
string<date-time>

End of the window, as an RFC 3339 timestamp with a time zone. Rounded down to the hour. Must not be in the future. Defaults to now.

bucket
enum<string>
default:day

Bucket size. Weeks start Monday 00:00 UTC. Months start on the 1st at 00:00 UTC.

Available options:
day,
week,
month
group_by
string
default:model

Comma-separated list of model and api_key. Pass an empty value (group_by=) for one result per bucket.

Response

The usage report

billing_mode
enum<string>

credit for prepaid credits, invoice for monthly invoicing.

Available options:
credit,
invoice
credits
object | null

Remaining prepaid credits. null for invoice accounts.

usage
object
keys
object[]

Every API key of the organization, revoked keys included, newest first.

spend_caps
object[]

The organization's spend caps, daily first. Empty when none are set.

as_of
string<date-time>

When this report was built.

Example:

"2026-12-03T00:51:12.000Z"