Fetch Token Report
GARetrieve detailed token usage statistics for a specific task.
This endpoint provides comprehensive token consumption data, including:
- Total tokens used across all task runs
- Token usage breakdown by time period
- Average tokens per request
- Usage patterns and trends
Parameters:
- start_date: Filter data from this date onward (supports both absolute dates and relative times)
- end_date: Filter data up to this date (supports both absolute dates and relative times)
Date Format Options:
- Absolute dates: ‘YYYY-MM-DD’ (e.g., ‘2024-01-15’)
- Relative times:
- ‘now’, ‘today’, ‘yesterday’
- ‘X hours/days/weeks ago’ (e.g., ‘24 hours ago’, ‘7 days ago’)
- ‘last week’, ‘last month’
Common Use Cases:
- Monitoring token consumption trends
- Cost analysis and budgeting
- Usage pattern analysis
- Resource allocation planning
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.
Headers
Authorization
Bearer authentication of the form Bearer <token>, where token is your auth token.
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’).
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