ClickHouse

Persist traces into a high-performance columnar analytics store

ClickHouse is ideal for large-volume token and cost analytics. Configure the destination once, then query traces with SQL for cost attribution and latency analysis.

broadcast-clickhouse-config.json
{
  "destination": "clickhouse",
  "enabled": true,
  "host": "https://clickhouse.example.com:8443",
  "database": "analytics",
  "table": "OPENROUTER_TRACES",
  "username": "therouter_writer",
  "password": "<secret>",
  "sampling_rate": 0.5
}
cURL
curl https://api.therouter.ai/v1/chat/completions   -H "Authorization: Bearer $THEROUTER_API_KEY"   -H "Content-Type: application/json"   -H "X-TheRouter.ai-Broadcast: true"   -d '{
    "model":"anthropic/claude-haiku-4.5",
    "messages":[{"role":"user","content":"Generate release notes"}],
    "trace":{"trace_name":"ClickHouse Ingest Test","team":"docs"}
  }'
Provision table schema first
Create the destination table and grant insert permissions before testing the connection, otherwise broadcast validation will fail with authorization or schema errors.