API reference · Usage
The current month's spend by product
/v1/orgs/{org_id}/usage/summary- TypeScript
client.usage.getSummary()- Python
client.usage.get_summary()- CLI
hayonix billing summary
Spend from the start of the current UTC month up to now, per product, computed the same way as the cost report.
Project API key (Authorization: Bearer sk_…), or a console session. Requires the usage:read permission (a key's scope, or a role that includes it).
Examples
The samples read API_KEY and API_BASE_URL from the environment (see Setup). Values are examples.
# The org of your key: GET /v1/caller
ORG_ID=$(curl -sS "$API_BASE_URL/caller" -H "Authorization: Bearer $API_KEY" | jq -r .org_id)
curl -sS "$API_BASE_URL/orgs/$ORG_ID/usage/summary" \
-H "Authorization: Bearer $API_KEY"Request
| Header | Required | Description |
|---|---|---|
Authorization | yes | Bearer and your API key. The key implies its project. |
Path parameters
org_idstringYour organization. The SDKs and the CLI fill it in from the API key.
ID with prefix org_
Response
200 UsageSummary — This month so far
objectstringrequiredAlways `usage_summary`: the type of this object
One of
usage_summarymonth_startstring (date-time)requiredStart of the current calendar month (UTC)
month_endstring (date-time)requiredStart of the next calendar month (UTC)
currencystringrequiredAlways `usd`
One of
usdtotalstringrequiredInteger nano-USD as a decimal string
pattern ^-?[0-9]+$
by_productarray of objectrequiredSpend per product this month, largest first
ShowHide 2 fields of
by_productproductstringrequiredcompute, inference, batch_inference, evaluations, training, storage, dedicated_endpoints or other
totalstringrequiredInteger nano-USD as a decimal string
pattern ^-?[0-9]+$
as_ofstring (date-time)requiredWhen the summary was computed
Example response
{
"object": "usage_summary",
"month_start": "2026-01-01T00:00:00.000Z",
"month_end": "2026-01-01T00:00:00.000Z",
"currency": "usd",
"total": "1500000000",
"by_product": [
{
"product": "string",
"total": "1500000000"
}
],
"as_of": "2026-01-01T00:00:00.000Z"
}Errors
Errors use the standard envelope. What this operation can answer:
| Status | Type | When |
|---|---|---|
401 | authentication_error | The key or session is missing, revoked or expired. |
403 | permission_error | The credential lacks the permission this needs, or the organization is suspended. |
429 | rate_limit_error rate_limited | Too many requests; retry after retry-after seconds. |