---
title: "Get the credits-spent series"
method: GET
path: "/credits/usage/spend_timeseries/"
tags: ["credits"]
---

# Get the credits-spent series

`GET /credits/usage/spend_timeseries/`

## Request

- Base URL: `https://api.getoneprofile.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.getoneprofile.ai/credits/usage/spend_timeseries/`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Get the spend series for the usage overview chart.

## Query parameters

- `start_time` string, date-time, required: Range start (ISO 8601)
- `end_time` string, date-time, required: Range end (ISO 8601)
- `interval` 'hour' | 'day'
- `timezone` string: IANA timezone for buckets

## Response `200`

Successful Response

- CreditSpendTimeseriesResponseSchema: The credits-spent series for the usage overview chart.
  - `buckets` CreditSpendBucketSchema[], required
    - `bucket_start` string, date-time, required
    - `credits_refunded` number, required: Refunded portion of the bucket, reported separately from credits_spent. 0 for rollup-granularity buckets (refunds are not broken out beyond the detail retention window). In decimal credits.
    - `credits_spent` number, required: Net of any refunds in the bucket, in decimal credits.
    - `units` integer, required: Items (cells) charged in the bucket.
  - `interval` string, required: Bucket size of the detailed part: hour or day.
  - `reduced_granularity_before` string, date-time, nullable, required: Buckets before this boundary are month-granularity rollups.
  - `total_credits_refunded` number, required: Headline refunded total for the range, in decimal credits.
  - `total_credits_spent` number, required: Headline total for the range, net of refunds, in decimal credits.
  - `total_units` integer, required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `422`: Invalid request made to the API.
- `500`: Internal server error.
- `502`: Bad gateway error.
- `503`: Service unavailable.

---

[API](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile.md) · [All operations](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile/llms.txt) · [OpenAPI document](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile/revisions/4a6bd71e3f02?raw)
