http
GET /projects/{project_reference}/analytics/ai-usageGet AI usage analytics.
Parameters
| Name | In | Required | Description |
|---|---|---|---|
project_reference | path | Yes | Project slug, UUID, or domain that identifies the project. |
preset | query | Whole local days, defaulting to 30d. Explicit from/to bounds take precedence over preset, including SDK-supplied defaults. | |
from | query | Inclusive start. Supply both from and to; these bounds take precedence over preset. | |
to | query | Exclusive end, no later than the end of today in timezone. | |
timezone | query | ||
granularity | query | UTC hours, or local calendar days, Monday-based weeks and months. | |
group_by | query | Grouping dimensions supported by this operation. Repeat the parameter or use a comma-separated list. | |
compare | query | Compare preceding calendar months for whole-month custom ranges, local days for whole-day ranges and presets, or equal elapsed duration otherwise. | |
member_id | query |
Responses
| Status | Description |
|---|---|
| 200 | Project AI usage and daily customer charges. Owners and administrators read the project or select a member; other members read only their own usage by passing their member ID. API keys are refused. Member reports include calls with recorded actor attribution. Account quotas and provider costs are excluded. |
| 400 | Bad request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not found |
| 500 | Server error |