Usage routes live under /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 the client 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/requests lists requests, paged by cursor.
  • GET /api/v1/me/usage/requests/:request_id returns one request.
The 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, or PATCH 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_bodies off deletes every body already kept for that project.

Gizzi

gizzi usage prints the same report from the terminal: --days, --group-by and --json.