---
title: "Get serverless billing history"
method: GET
path: "/v2/billing/serverless"
tags: ["Billing"]
---

# Get serverless billing history

`GET /v2/billing/serverless`

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.

## Query parameters

- `startTime` string, date-time
- `endTime` string, date-time
- `bucketSize` 'hour' | 'day' | 'week' | 'month' | 'year' — Length of each billing time bucket.
- `lastN` integer
- `serverlessId` string

## Response `200`

OK

- ListServerlessBillingResponse — Billing records for serverless.
  - `records` ServerlessBillingRecord[], required
    - `startTime` string, date-time, required — Start of the range, inclusive (RFC 3339).
    - `endTime` string, date-time, required — End of the range, exclusive (RFC 3339).
    - `totalAmount` number, double, required — Total serverless cost in USD for the bucket.
    - `gpuAmount` number, double, required — Serverless GPU compute cost in USD for the bucket.
    - `cpuAmount` number, double, required — Serverless CPU compute cost in USD for the bucket.
    - `diskAmount` number, double, required — Serverless disk cost in USD for the bucket.
    - `feeAmount` number, double, required — Serverless platform fee in USD for the bucket.
    - `serverlessId` string, required — The serverless endpoint this record bills. When the serverlessId filter is set every record carries that id; otherwise one record is emitted per serverless endpoint per bucket.
  - `metadata` ServerlessBillingMetadata, required
    - `query` ServerlessBillingQuery, required — Half-open time range [startTime, endTime) in RFC 3339. On a record it is the time bucket; on a query echo it is the resolved window.
      - `startTime` string, date-time, required — Start of the range, inclusive (RFC 3339).
      - `endTime` string, date-time, required — End of the range, exclusive (RFC 3339).
      - `bucketSize` 'hour' | 'day' | 'week' | 'month' | 'year', required — Length of each billing time bucket.
      - `serverlessId` string, nullable — The serverlessId filter applied, if any.
    - `recordCount` integer, required — Number of records returned (buckets times distinct endpoints).
    - `uniqueServerlessCount` integer, required — Number of distinct serverless endpoints the records span.
    - `totals` ServerlessBillingAmounts, required — Serverless cost components. Backs a record's amounts and the metadata totals.
      - `totalAmount` number, double, required — Total serverless cost in USD for the bucket.
      - `gpuAmount` number, double, required — Serverless GPU compute cost in USD for the bucket.
      - `cpuAmount` number, double, required — Serverless CPU compute cost in USD for the bucket.
      - `diskAmount` number, double, required — Serverless disk cost in USD for the bucket.
      - `feeAmount` number, double, required — Serverless platform fee in USD for the bucket.

## Other responses

- `401` — Authentication failed because the bearer token is missing, malformed, expired, or invalid.
- `403` — The bearer token is valid, but it does not grant access to the requested resource or action.
- `429` — The caller exceeded its per-user rate limit. The response identifies the window that was exceeded and how long to wait. The `RateLimit` and `RateLimit-Policy` headers (per the IETF ratelimit-headers draft) also accompany successful responses, so clients can track quota before a 429.
- `default` — Error

---

[API](https://skmtc.net/runpod/apis/runpod-rest-api.md) · [All operations](https://skmtc.net/runpod/apis/runpod-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/runpod/runpod-rest-api/versions/504cd0394ed6/schema)
