Fetch Token Report

Retrieve aggregate token usage statistics for a specific task. This report returns: - Total input, output, and combined tokens across the filtered time range - A per-revision token breakdown - Optional segmentation by reporting group Parameters: - `start_date`: Filter data from this date onward - `end_date`: Filter data up to this date - `show_reporting_group`: Include reporting group segmentation in the per-revision breakdown

Authentication

AuthorizationBearer

API key or access token, sent as Authorization: Bearer <token>. The simplest option: create an API key in your dashboard under Settings, then paste it here.

OR
AuthorizationBearer

API key or access token, sent as Authorization: Bearer <token>. The simplest option: create an API key in your dashboard under Settings, then paste it here.

Path parameters

org_idstringRequiredformat: "uuid"
The unique identifier of the organization.
project_idstringRequiredformat: "uuid"
The unique identifier of the project.
task_idstringRequiredformat: "uuid"
The specific Task to reference.

Query parameters

start_datestring or nullOptional

Start date for the report (e.g., ‘2023-06-01’, ‘24 hours ago’, ‘yesterday’).

end_datestring or nullOptional

End date for the report (e.g., ‘2023-06-30’, ‘now’, ‘today’).

show_reporting_groupbooleanOptionalDefaults to false
If true, include reporting group in the report.

Response

Successfully retrieved token usage report
task_idstringformat: "uuid"
Unique identifier of the task
date_rangemap from strings to nullable strings
Time period covered by the report, with start and end timestamps
total_input_tokensinteger>=0
Total number of input tokens consumed across all revisions and runs
total_output_tokensinteger>=0
Total number of output tokens generated across all revisions and runs
total_tokensinteger>=0
Combined total of input and output tokens across all revisions
total_task_runsinteger>=0
Total number of task executions across all revisions
task_revisionslist of objects
Token usage breakdown by task revision, showing detailed statistics for each active revision

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
500
Internal Server Error