v1

latestOpenAPI 3.1.02026-07-2676123203.9 KB
Billing

Get serverless billing history

Returns serverless endpoint billing detail for the authenticated user, split into time buckets by startTime/endTime with bucketSize or by lastN recent buckets. Use serverlessId to filter to one endpoint; without it, records are emitted per serverless endpoint per bucket. Each record reports endpoint-level GPU, CPU, disk, platform fee, and total amounts. This is distinct from pod billing, which covers standalone GPU and CPU pod costs rather than serverless endpoint workloads.

get/v2/billing/serverless

Query parameters

startTimestring date-time

Start of the billing period (RFC 3339). Defaults to 30 days ago. Snapped down to the start of its bucketSize bucket so the window aligns with the returned records; provide a boundary-aligned value (e.g. midnight for bucketSize=day) to avoid widening.

endTimestring date-time

End of the billing period (RFC 3339), exclusive. Defaults to now. Snapped up to the end of the bucketSize bucket it lands in (unless already on a boundary) so the window aligns with the returned records.

bucketSize'hour' | 'day' | 'week' | 'month' | 'year'

Length of each billing time bucket.

Example:day

Length of each billing time bucket. Defaults to day.

lastNinteger

Return the last N buckets of bucketSize, ending with the current (in-progress) bucket — e.g. lastN=100 with bucketSize=day is "last 100 days". The resolved window is aligned to bucket boundaries: startTime is the start of the earliest bucket (e.g. midnight of the earliest day) and endTime is the end of the current bucket. Mutually exclusive with startTime/endTime; provide one or the other, not both.

serverlessIdstring

Filter to a specific serverless endpoint.

Response

OK

Example response

{
  "records": [
    {
      "startTime": "2026-06-01T00:00:00Z",
      "endTime": "2026-06-02T00:00:00Z",
      "totalAmount": 8.9,
      "serverlessId": "ep_abc123"
    }
  ],
  "metadata": {
    "query": {
      "startTime": "2026-06-01T00:00:00Z",
      "endTime": "2026-06-02T00:00:00Z",
      "bucketSize": "day"
    },
    "totals": {
      "totalAmount": 8.9
    }
  }
}