Retrieve LLM token usage statistics for a specific task, including input/output token counts and the number of tool actions performed.
Path Parameters
Unique identifier of the task (UUID format)
Response
Unique identifier of the task
Total number of LLM tokens consumed (input + output)
Number of input (prompt) tokens consumed
Number of output (completion) tokens generated
Number of tool actions performed during the task
Whether the task used a Bring Your Own Key (BYOK) model configuration
Example Request
curl -X GET -H "x-api-key: <your-api-key>" \
"https://api.xpander.ai/v1/tasks/<task-id>/llm_usage"
Example Response
{
"task_id": "e6cf93db-30c7-471b-a1a9-5051a2c9e4ba",
"tokens": 3842,
"input_tokens": 1520,
"output_tokens": 2322,
"actions": 4,
"is_byok": false
}
Use Cases
- Track token consumption - Monitor LLM token usage for individual tasks
- Cost analysis - Calculate per-task LLM costs based on input/output tokens
- Usage auditing - Review resource consumption across tasks
- BYOK tracking - Identify which tasks ran with your own API keys vs. platform-provided keys
API Key for authentication