PostHog
Analyze LLM usage behavior in product analytics workflows
PostHog broadcast emits LLM analytics events so you can tie model spend and quality to feature adoption, user cohorts, and funnel performance.
broadcast-posthog-config.json
{
"destination": "posthog",
"enabled": true,
"api_key": "phc_...",
"endpoint": "https://us.i.posthog.com",
"sampling_rate": 1
}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":"openai/gpt-4.1-mini",
"messages":[{"role":"user","content":"Recommend an upgrade plan"}],
"user":"user_88",
"trace":{"trace_name":"PostHog Event Test","feature":"upsell-assistant"}
}'Verification
In PostHog LLM analytics, filter by `$ai_user` or your custom `feature` property to validate event flow.