Skip to content
Hayonix

API reference · Schema

CostReport

  • objectstringrequired

    Always `cost_report`: the type of this object

    One ofcost_report

  • startstring (date-time)required

    Start of the reported period (inclusive)

  • endstring (date-time)required

    End of the reported period (exclusive)

  • bucketstringrequired

    Width of each `series` bucket, aligned to UTC

    One ofdayhour

  • group_bystringrequired

    What `key` identifies in `breakdown` and `series`: `product` (compute, inference, batch_inference, evaluations, training, storage, dedicated_endpoints, other), `line_item` (`<meter>:<price_key>`, the meter and price key of the price sheet), `project` (a project ID) or `api_key` (an API key ID, `none` for usage not made with a key)

    One ofproductline_itemprojectapi_key

  • currencystringrequired

    Always `usd`

    One ofusd

  • totalstringrequired

    Integer nano-USD as a decimal string

    pattern ^-?[0-9]+$

  • breakdownarray of objectrequired

    One row per group, largest first

    Show 3 fields of breakdown
    • keystringrequired

      The group, as chosen by `group_by`

    • totalstringrequired

      Integer nano-USD as a decimal string

      pattern ^-?[0-9]+$

    • quantitystring | nullrequired

      Total units used in the period, as a decimal string, in the line item's meter unit (tokens, seconds, characters…); null unless `group_by` is `line_item`

  • seriesarray of objectrequired

    Spend per bucket and group in time order; buckets and groups with no spend are left out

    Show 3 fields of series
    • bucket_startstring (date-time)required

      Start of the bucket (UTC)

    • keystringrequired

      The group, as chosen by `group_by`

    • amountstringrequired

      Integer nano-USD as a decimal string

      pattern ^-?[0-9]+$

Example
{
  "object": "cost_report",
  "start": "2026-01-01T00:00:00.000Z",
  "end": "2026-01-01T00:00:00.000Z",
  "bucket": "day",
  "group_by": "product",
  "currency": "usd",
  "total": "1500000000",
  "breakdown": [
    {
      "key": "string",
      "total": "1500000000",
      "quantity": "string"
    }
  ],
  "series": [
    {
      "bucket_start": "2026-01-01T00:00:00.000Z",
      "key": "string",
      "amount": "1500000000"
    }
  ]
}

Used by