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

# Spend Breakdown

> Aggregate spend by category for a given period

Returns total spend grouped by [receipt category](/api-reference/analytics/overview#receipt-categories), plus per-category counts and percentages of total. Free endpoint — requires `X-Agent-ID` only.

## Query Parameters

<ParamField query="period" type="number" default="30">
  Period in days (1–365)
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://win.oneshotagent.com/v1/analytics/spend/breakdown?period=30" \
    -H "X-Agent-ID: 0xYourWalletAddress"
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "categories": [
      { "category": "communication", "total": "4.500000", "count": 30, "pct": 45.0 },
      { "category": "data", "total": "3.200000", "count": 16, "pct": 32.0 },
      { "category": "infrastructure", "total": "2.300000", "count": 4, "pct": 23.0 }
    ],
    "total": "10.000000",
    "period_days": 30
  }
  ```
</ResponseExample>
