curl --request POST \
--url https://control-plane.kubiya.ai/api/v1/analytics/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"execution_id": "<string>",
"turns": [
{
"execution_id": "<string>",
"turn_number": 123,
"model": "<string>",
"started_at": "<string>",
"turn_id": "<string>",
"model_provider": "<string>",
"completed_at": "<string>",
"duration_ms": 123,
"input_tokens": 0,
"output_tokens": 0,
"cache_read_tokens": 0,
"cache_creation_tokens": 0,
"total_tokens": 0,
"input_cost": 0,
"output_cost": 0,
"cache_read_cost": 0,
"cache_creation_cost": 0,
"total_cost": 0,
"finish_reason": "<string>",
"response_preview": "<string>",
"tools_called_count": 0,
"tools_called_names": [
"<string>"
],
"error_message": "<string>",
"metrics": {},
"runtime_minutes": 0,
"model_weight": 1,
"tool_calls_weight": 1,
"aem_value": 0,
"aem_cost": 0
}
],
"tool_calls": [
{
"execution_id": "<string>",
"tool_name": "<string>",
"started_at": "<string>",
"turn_id": "<string>",
"tool_use_id": "<string>",
"completed_at": "<string>",
"duration_ms": 123,
"tool_input": {},
"tool_output": "<string>",
"tool_output_size": 123,
"success": true,
"error_message": "<string>",
"error_type": "<string>",
"metadata": {}
}
],
"tasks": [
{
"execution_id": "<string>",
"task_description": "<string>",
"task_number": 123,
"task_id": "<string>",
"task_type": "<string>",
"status": "pending",
"started_at": "<string>",
"completed_at": "<string>",
"duration_ms": 123,
"result": "<string>",
"error_message": "<string>",
"metadata": {}
}
]
}
'{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create analytics data in batch.
This endpoint allows workers to send all analytics data (turns, tool calls, tasks) in a single request, reducing round trips and improving performance.
curl --request POST \
--url https://control-plane.kubiya.ai/api/v1/analytics/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"execution_id": "<string>",
"turns": [
{
"execution_id": "<string>",
"turn_number": 123,
"model": "<string>",
"started_at": "<string>",
"turn_id": "<string>",
"model_provider": "<string>",
"completed_at": "<string>",
"duration_ms": 123,
"input_tokens": 0,
"output_tokens": 0,
"cache_read_tokens": 0,
"cache_creation_tokens": 0,
"total_tokens": 0,
"input_cost": 0,
"output_cost": 0,
"cache_read_cost": 0,
"cache_creation_cost": 0,
"total_cost": 0,
"finish_reason": "<string>",
"response_preview": "<string>",
"tools_called_count": 0,
"tools_called_names": [
"<string>"
],
"error_message": "<string>",
"metrics": {},
"runtime_minutes": 0,
"model_weight": 1,
"tool_calls_weight": 1,
"aem_value": 0,
"aem_cost": 0
}
],
"tool_calls": [
{
"execution_id": "<string>",
"tool_name": "<string>",
"started_at": "<string>",
"turn_id": "<string>",
"tool_use_id": "<string>",
"completed_at": "<string>",
"duration_ms": 123,
"tool_input": {},
"tool_output": "<string>",
"tool_output_size": 123,
"success": true,
"error_message": "<string>",
"error_type": "<string>",
"metadata": {}
}
],
"tasks": [
{
"execution_id": "<string>",
"task_description": "<string>",
"task_number": 123,
"task_id": "<string>",
"task_type": "<string>",
"status": "pending",
"started_at": "<string>",
"completed_at": "<string>",
"duration_ms": 123,
"result": "<string>",
"error_message": "<string>",
"metadata": {}
}
]
}
'{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Enter your Kubiya API token (format: Bearer
Schema for batch creating analytics data (used by workers to send all data at once)
Show child attributes
Show child attributes
Show child attributes
Successful Response
Was this page helpful?