Skip to main content
POST
/
api
/
v1
/
analytics
/
batch
Create Batch Analytics
curl --request POST \
  --url https://control-plane.kubiya.ai/api/v1/analytics/batch \
  --header 'Content-Type: application/json' \
  --data '{
  "execution_id": "<string>",
  "turns": [
    {
      "execution_id": "<string>",
      "turn_number": 123,
      "turn_id": "<string>",
      "model": "<string>",
      "model_provider": "<string>",
      "started_at": "<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>",
      "turn_id": "<string>",
      "tool_name": "<string>",
      "tool_use_id": "<string>",
      "started_at": "<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_number": 123,
      "task_id": "<string>",
      "task_description": "<string>",
      "task_type": "<string>",
      "status": "pending",
      "started_at": "<string>",
      "completed_at": "<string>",
      "duration_ms": 123,
      "result": "<string>",
      "error_message": "<string>",
      "metadata": {}
    }
  ]
}'
"<any>"

Body

application/json

Schema for batch creating analytics data (used by workers to send all data at once)

execution_id
string
required
turns
TurnMetricsCreate · object[]
tool_calls
ToolCallCreate · object[]
tasks
TaskCreate · object[]

Response

Successful Response

The response is of type any.