Summary
GET /analytics/summaryReturns a summary of your organization’s usage with a comparison to the previous period.
Query parameters
Section titled “Query parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
range | string | "7days" | Time range: "1h", "24h", "7days", "30days", "3months" |
Response
Section titled “Response”{ "current": { "requests": 1250, "input_tokens": 542000, "output_tokens": 128000 }, "previous": { "requests": 980, "input_tokens": 410000, "output_tokens": 95000 }, "timeseries": [ { "timestamp": "2025-01-15T00:00:00Z", "tokens": 15200 } ]}Response fields
Section titled “Response fields”| Field | Description |
|---|---|
current | Totals for the selected time range |
previous | Totals for the equivalent preceding period (for comparison) |
timeseries | Token usage over time within the current range |
Example
Section titled “Example”curl "https://api.aiand.com/analytics/summary?range=30days" \ -H "Authorization: Bearer sk-your-api-key"Use cases
Section titled “Use cases”- Display usage trends on a dashboard
- Calculate period-over-period growth (
(current - previous) / previous) - Visualize token consumption over time with the
timeseriesdata