Developer analytics
Query revenue, cost, profit, requests, tokens, and user activity for your apps. Same data the dashboard reads — straight from the ledger.
GEThttps://api.usequota.ai/developers/analytics/summary
GEThttps://api.usequota.ai/developers/analytics/timeseries
GEThttps://api.usequota.ai/developers/analytics/breakdown
PATCHhttps://api.usequota.ai/developers/apps/:id/settings
GEThttps://api.usequota.ai/developers/apps/:id/users
Summary#
Returns aggregated totals across all apps in the date range — revenue, cost, profit, users, requests, tokens.
curl "https://api.usequota.ai/developers/analytics/summary?startDate=2025-12-01&endDate=2025-12-31" \
-H "Authorization: Bearer sess_your_token"{
"summary": {
"revenue": 12500000,
"cost": 8200000,
"profit": 4300000,
"users": 142,
"requests": 5681,
"tokens": 1832500
},
"period": {
"start": "2025-12-01T00:00:00.000Z",
"end": "2025-12-31T00:00:00.000Z"
}
}Query parameters
| startDateISO 8601 date | Inclusive start of the window. Defaults to 30 days ago. |
| endDateISO 8601 date | Inclusive end of the window. Defaults to now. |
Time series#
One metric over time, bucketed by interval. Useful for charts.
curl "https://api.usequota.ai/developers/analytics/timeseries?metric=revenue&interval=day&startDate=2025-12-01&endDate=2025-12-31" \
-H "Authorization: Bearer sess_your_token"Query parameters
| metricstring | One of revenue, cost, profit, users, requests, tokens. Defaults to revenue. |
| intervalstring | Bucket size: hour, day, week, or month. Defaults to day. |
| startDateISO 8601 date | Defaults to 30 days ago. |
| endDateISO 8601 date | Defaults to now. |
Breakdown#
Group one metric by model, user, or app. Returns rows ordered by the chosen metric.
curl "https://api.usequota.ai/developers/analytics/breakdown?groupBy=model&metric=profit&startDate=2025-12-01&endDate=2025-12-31" \
-H "Authorization: Bearer sess_your_token"Query parameters
| groupBystring | One of model, user, or app. Defaults to model. |
| metricstring | One of revenue, cost, profit, requests, tokens. Defaults to revenue. Note: users is not a valid breakdown metric. |
| startDateISO 8601 date | Defaults to 30 days ago. |
| endDateISO 8601 date | Defaults to now. |
App settings#
Update an app's profit_margin and markup_percentage. Both fields are optional; pass either or both.
curl -X PATCH https://api.usequota.ai/developers/apps/APP_ID/settings \
-H "Authorization: Bearer sess_your_token" \
-H "Content-Type: application/json" \
-d '{"profit_margin": 0.2, "markup_percentage": 20}'Body
| profit_marginnumber | Float between 0 and 1, e.g. 0.2 for 20%. Bounded server-side. |
| markup_percentagenumber | Non-negative number, e.g. 20 for 20%. Used by streaming reservation. |
Error responses#
400invalid_metricmetric is not one of the supported values.
400invalid_intervalinterval is not hour, day, week, or month.
400invalid_group_bygroupBy is not model, user, or app.
400invalid_datestartDate or endDate is not a parseable date.
401unauthorizedMissing or invalid session token.
403forbiddenApp belongs to a different developer.
404not_foundNo app with that id.
All errors return a JSON body:
{
"error": {
"code": "unauthorized",
"message": "Missing or invalid session token"
}
}