Skip to content
Hayonix

API reference · Usage

The current month's spend by product

GET/v1/orgs/{org_id}/usage/summary
API keyusage:readOrganization
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

Headers
HeaderRequiredDescription
AuthorizationyesBearer and your API key. The key implies its project.

Path parameters

  • org_idstring

    Your organization. The SDKs and the CLI fill it in from the API key.

    ID with prefix org_

Response

200 UsageSummary — This month so far

  • objectstringrequired

    Always `usage_summary`: the type of this object

    One ofusage_summary

  • month_startstring (date-time)required

    Start of the current calendar month (UTC)

  • month_endstring (date-time)required

    Start of the next calendar month (UTC)

  • currencystringrequired

    Always `usd`

    One ofusd

  • totalstringrequired

    Integer nano-USD as a decimal string

    pattern ^-?[0-9]+$

  • by_productarray of objectrequired

    Spend per product this month, largest first

    Show 2 fields of by_product
    • productstringrequired

      compute, inference, batch_inference, evaluations, training, storage, dedicated_endpoints or other

    • totalstringrequired

      Integer nano-USD as a decimal string

      pattern ^-?[0-9]+$

  • as_ofstring (date-time)required

    When the summary was computed

Example response
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:

Errors
StatusTypeWhen
401authentication_errorThe key or session is missing, revoked or expired.
403permission_errorThe credential lacks the permission this needs, or the organization is suspended.
429rate_limit_error rate_limitedToo many requests; retry after retry-after seconds.