Skip to navigation

List per-session token usage for a workspace

Beta

Per-session LLM token usage for one workspace — the same rows as the workspace usage CSV export, as JSON. Each session yields one row per provider/model/status combination with its token breakdown and billed cost; dry-run (test) sessions are excluded. Pick the window with from/to (UTC dates, inclusive, at most 365 days) or a rolling days. Pages are keyset-paginated newest first: limit counts sessions, and next_cursor is returned while more sessions remain. Requires workspace owner or manager (or Athena admin) permissions.

Authentication

X-API-KEYstring
API Key authentication via header

Path parameters

workspace_idstringRequired
Unique identifier of the workspace

Headers

X-Athena-Session-CredentialstringOptional

Query parameters

fromstring or nullOptional

First UTC day of the window (YYYY-MM-DD); requires to

tostring or nullOptional

Last UTC day of the window, inclusive (YYYY-MM-DD); requires from

daysintegerOptional1-365Defaults to 30

Rolling window in days ending now; ignored when from/to are given

cursorstring or nullOptional

next_cursor from the previous page

limitintegerOptional1-500Defaults to 100

Maximum sessions per page (each may yield several rows)

Response

One page of session rows
next_cursorstring or null

Pass as cursor to fetch the next page; null when the window is exhausted

sessionslist of objects
Rows for this page, newest session first
windowobject
The reporting window a usage page covers.
workspace_idstring
Workspace the rows belong to

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error