/api/v1/me/usage. They accept any signed-in user or Gizzi token, so the console and gizzi usage read the same data.
Report
GET /api/v1/me/usage/report
The JSON body is
{ "rows": [{ "group", "requests", "prompt_tokens", "completion_tokens", "cost_usd" }] }. The CSV starts with a header row. scope=org needs an organization admin, and the organization comes from your session, never from a parameter. You cannot read another user’s or organization’s usage.
Client labels
The server sets theclient value on each call. A device token is runtime, a Playground key is playground, a request with the header X-Allternit-Client: gizzi-code/<version> is gizzi-code, and anything else is api.
Request log
GET /api/v1/me/usage/requestslists requests, paged by cursor.GET /api/v1/me/usage/requests/:request_idreturns one request.
request_id is the x-request-id header of the original response. The log lists billed requests only. A call that failed before it was billed has no row. Both endpoints accept scope=org (organization admins only), and the Logs page has a scope switch for admins that changes it between just you and the whole organization.
Request and response bodies
Bodies are off by default. The log keeps metadata (model, tokens, cost, latency, key, project, client) for every request. To keep bodies too, turn on “Keep request and response bodies for 30 days (for Logs replay)” in the project’s Edit panel, orPATCH the project with log_bodies: true. From then on, a request detail includes the request and response bodies.
- Bodies are deleted 30 days after the request.
- A request and response larger than 1 MB together are not kept.
- Turning
log_bodiesoff deletes every body already kept for that project.
Gizzi
gizzi usage prints the same report from the terminal: --days, --group-by and --json.