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_id
The unique identifier of the organization.
project_id
The unique identifier of the project.
task_id
The specific Task to reference.
Query parameters
start_date
Start date for the report (e.g., ‘2023-06-01’, ‘24 hours ago’, ‘yesterday’).
end_date
End date for the report (e.g., ‘2023-06-30’, ‘now’, ‘today’).
show_reporting_group
If true, include reporting group in the report.
Response
Successfully retrieved token usage report
task_id
Unique identifier of the task
date_range
Time period covered by the report, with start and end timestamps
total_input_tokens
Total number of input tokens consumed across all revisions and runs
total_output_tokens
Total number of output tokens generated across all revisions and runs
total_tokens
Combined total of input and output tokens across all revisions
total_task_runs
Total number of task executions across all revisions
task_revisions
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