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

# GET /analytics/daily — Daily Spend Trend Breakdown

> Returns per-day AI spend totals and request counts for up to 90 days, helping you track trends and detect anomalies across your billing period.

The daily endpoint returns a time-series of your AI spend aggregated by calendar day. Use it to plot spend trends, detect anomalies, or understand how usage ramps up over a billing period. You can request up to 90 days of history in a single call.

**Endpoint**

```text theme={null}
GET https://tokonomics.ca/analytics/daily
```

## Query Parameters

<ParamField query="days" type="integer" default="30">
  The number of past days to include in the response, counting back from today. Must be between `1` and `90`. Defaults to `30`.

  ```text theme={null}
  GET /analytics/daily?days=14
  ```
</ParamField>

## Response Fields

<ResponseField name="days" type="array">
  An array of daily spend records ordered from oldest to most recent.

  <Expandable title="days fields">
    <ResponseField name="date" type="string">
      The calendar date for this record in `YYYY-MM-DD` format. Example: `"2026-06-10"`
    </ResponseField>

    <ResponseField name="spend" type="number">
      Total AI spend in USD for this day. Example: `14.32`
    </ResponseField>

    <ResponseField name="requests" type="integer">
      Total number of proxied LLM requests on this day. Example: `730`
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

<CodeGroup>
  ```bash Request theme={null}
  curl "https://tokonomics.ca/analytics/daily?days=7" \
    -H "Authorization: Bearer mk_your_key"
  ```

  ```json Response theme={null}
  {
    "days": [
      {"date": "2026-06-04", "spend": 18.91, "requests": 940},
      {"date": "2026-06-05", "spend": 21.44, "requests": 1082},
      {"date": "2026-06-06", "spend": 9.05,  "requests": 455},
      {"date": "2026-06-07", "spend": 7.30,  "requests": 368},
      {"date": "2026-06-08", "spend": 22.10, "requests": 1115},
      {"date": "2026-06-09", "spend": 19.87, "requests": 1003},
      {"date": "2026-06-10", "spend": 14.32, "requests": 730}
    ]
  }
  ```
</CodeGroup>
