Developer Analytics API

Query revenue, cost, profit, requests, tokens, and user activity for your apps. Requires a session token (sess_...).

Authentication

Sign in via POST /auth/login to obtain a session token. Send it as Authorization: Bearer sess_....

Summary

GET /developers/analytics/summary?startDate=YYYY-MM-DD&endDate=YYYY-MM-DD

curl "https://api.usequota.ai/developers/analytics/summary?startDate=2025-12-01&endDate=2025-12-31" \
  -H "Authorization: Bearer sess_your_token"

Returns totals across all apps for the period (revenue, cost, profit, users, requests, tokens).

Time Series

GET /developers/analytics/timeseries?metric=revenue&interval=day&startDate=...&endDate=...

Supported metrics: revenue, cost, profit, users, requests, tokens. Intervals: hour, day, week, month.

Breakdown

GET /developers/analytics/breakdown?groupBy=model&metric=profit&startDate=...&endDate=...

Group by model, user, or app; metrics match the time series endpoint.

App Settings

PATCH /developers/apps/:id/settings updates profit margin.

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}'

App Users with Stats

GET /developers/apps/:id/users lists app users with balance and usage summaries.

Error Responses

StatusCodeDescription
401unauthorizedMissing or invalid session token
400bad_requestMissing required query parameters

All errors return a JSON body:

{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid session token"
  }
}