> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Usage Trend V1

> Daily cost / token / job-count trend. Returns a zero-filled per-day rollup so dashboards can render a sparkline without client-side gap-filling…

Daily cost / token / job-count trend.

Returns a zero-filled per-day rollup so dashboards can render a
sparkline without client-side gap-filling. Always uses UTC calendar
days; same-day usage records are aggregated regardless of when in
the day they landed.

### Query parameters

<ParamField query="period" type="string">
  Window length. One of 7d / 30d / 90d.
</ParamField>

### Response

`UsageTrendResponse`

<ResponseField name="period" type="string" required>
  The window queried ('7d', '30d', '90d').
</ResponseField>

<ResponseField name="start_date" type="string" required />

<ResponseField name="end_date" type="string" required />

<ResponseField name="buckets" type="UsageTrendBucket[]" required>
  Day-by-day rollup, oldest first, with zero-filled rows for dates that had no activity. Length always equals the period in days.

  <Expandable title="UsageTrendBucket">
    <ResponseField name="date" type="string" required>
      ISO 8601 calendar date (UTC).
    </ResponseField>

    <ResponseField name="jobs" type="integer" required>
      Count of billed runs that completed on this day.
    </ResponseField>

    <ResponseField name="tokens" type="integer" required>
      Sum of input + output tokens.
    </ResponseField>

    <ResponseField name="cost_usd" type="number" required>
      Total billed cost in USD.
    </ResponseField>
  </Expandable>
</ResponseField>

### Status codes

| Code  | Meaning             |
| ----- | ------------------- |
| `200` | Successful Response |
| `422` | Validation Error    |

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.computer.stateset.app/api/v1/usage/trend' \
    --header 'X-API-Key: YOUR_API_KEY'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "period": "string",
    "start_date": "2026-08-31T14:22:05Z",
    "end_date": "2026-08-31T14:22:05Z",
    "buckets": [
      {
        "date": "2026-08-31T14:22:05Z",
        "jobs": 1,
        "tokens": 1,
        "cost_usd": 1.5
      }
    ]
  }
  ```
</ResponseExample>
