---
title: "Get the org credit usage history"
method: GET
path: "/org/credits/history"
tags: ["Credits"]
---

# Get the org credit usage history

`GET /org/credits/history`

## Request

- Base URL: `https://apiv2.senso.ai/api/v1`
- URL: `https://apiv2.senso.ai/api/v1/org/credits/history`
- Auth: API key in header `X-API-Key`

Returns a day-by-day breakdown of the organization's credit spend over a
trailing window, plus the total spent across it — enough to draw a usage chart
or spot a trend without post-processing.

Every day in the window is present, so a day with no spend comes back with a
`usage` of `0` and there are no gaps to fill. Entries run oldest to newest and
the last one is today, which is still accumulating — its `usage` will keep
rising until the day closes.

## Query parameters

- `days` integer

## Response `200`

The daily usage series for the requested window.

- OrgCreditHistoryResponse: Daily credit spend across a trailing window, with the window total.
  - `org_id` string, uuid, required
  - `days` integer, required: The window that was applied — your `days` parameter, or the default.
  - `period_usage` number, required: Credits spent across the window, equal to the sum of `history[].usage`. This covers the requested window only — for lifetime spend read `total_usage` from `GET /org/credits/balance`, which will not match.
  - `history` OrgCreditHistoryEntry[], required: One entry per day, oldest first, always exactly `days` entries long.
    - `date` string, date, required: The calendar day, as `YYYY-MM-DD`.
    - `usage` number, required: Credits spent that day — `0` on a day with no spend.

## Other responses

- `400`: The request was malformed — a bad path/query parameter or an invalid value.
- `401`: Missing or invalid credentials — supply a valid org API key in the `X-API-Key` header.

---

[API](https://skmtc.dev/senso/apis/senso-org-api.md) - [All operations](https://skmtc.dev/senso/apis/senso-org-api/llms.txt) - [OpenAPI document](https://skmtc.dev/senso/apis/senso-org-api/revisions/d789b4fcbe84?raw)
