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

# Usage History

> Time series of your requests and credits over the last `days` days, bucketed at `15m`, `1h`, `6h` or `1d`: the graph of a usage dashboard. Free.

`GET /v1/usage/history`

Time series of the calling key's requests and credits over the last `days` days, bucketed at `15m`, `1h`, `6h` or `1d`: the graph of a usage dashboard. Free: never billed, and still reachable when the monthly credit allowance is exhausted. A key only ever sees its own usage.

<Note>Each point is `{ t, requests, credits }`; `t` is the bucket start in unix seconds. Buckets without traffic are absent from the series.</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl 'https://api.serialized.xyz/v1/usage/history?days=7&bucket=1d' \
    -H 'Authorization: YOUR_API_KEY'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": {
      "days": 7,
      "bucket": "1d",
      "series": [
        {
          "t": 1788393600,
          "requests": 100,
          "credits": 214
        },
        {
          "t": 1788480000,
          "requests": 2516,
          "credits": 5469
        },
        {
          "t": 1788566400,
          "requests": 1870,
          "credits": 7635
        },
        {
          "t": 1788652800,
          "requests": 224,
          "credits": 501
        },
        {
          "t": 1788739200,
          "requests": 46,
          "credits": 135
        },
        {
          "t": 1788825600,
          "requests": 38,
          "credits": 133
        },
        {
          "t": 1788912000,
          "requests": 226,
          "credits": 443
        }
      ]
    },
    "meta": {
      "asOf": 1788980722720
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi.json GET /v1/usage/history
openapi: 3.1.0
info:
  title: Serialized Data API
  description: >-
    On-chain data for trading apps - tokens, candles, token filters. Built on
    our own indexers. 18 EVM chains + Solana, live.
  version: 0.1.0
servers:
  - url: https://demo.serialized.xyz
    description: 'Demo: no key needed, read endpoints, rate-limited per IP'
  - url: https://api.serialized.xyz
    description: 'Production: your API key in the Authorization header'
security:
  - apiKey: []
  - {}
paths:
  /v1/usage/history:
    get:
      summary: Usage History
      description: >-
        Time series of your requests and credits over the last `days` days,
        bucketed at `15m`, `1h`, `6h` or `1d`: the graph of a usage dashboard.
        Free.
      operationId: usage-history
      parameters:
        - schema:
            minimum: 1
            maximum: 90
            default: 30
            type: integer
            x-default: 7
          in: query
          name: days
          required: false
          description: 1 to 90. Default 30.
          example: 7
        - schema:
            default: 1d
            type: string
            x-default: 1d
          in: query
          name: bucket
          required: false
          description: >-
            `15m`, `1h`, `6h` or `1d` (default). A bucket too fine for the range
            (more than about 2,200 points) is refused with `400`: pick a coarser
            one.
          example: 1d
      responses:
        '200':
          description: Standard `{ data, meta }` envelope.
components:
  securitySchemes:
    apiKey:
      type: apiKey
      name: Authorization
      in: header
      description: Your raw API key (not needed on the demo server).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.