Send OpenDunes requests to PostHog LLM analytics as $ai_generation events.
With the posthog destination, every OpenDunes request arrives in PostHog as an $ai_generation event, where PostHog's LLM analytics reads it.
| Setting | Required | Description |
|---|---|---|
apiKey | Yes | Your PostHog project API key |
endpoint | No | Your PostHog address. Default https://us.i.posthog.com; set your region's, or your own instance's |
curl https://opendunes.com/v1/observability/destinations \
-H "Authorization: Bearer $OPENDUNES_MANAGEMENT_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "PostHog",
"type": "posthog",
"config": { "apiKey": "phc_…" }
}'One $ai_generation event per request at {endpoint}/i/v0/e/, with $ai_model, $ai_provider, $ai_input, $ai_output_choices, $ai_input_tokens, $ai_output_tokens, $ai_latency in seconds, $ai_is_error, $ai_trace_id and $ai_session_id, plus total_cost in DA and your trace fields as metadata_<key>.
The event's person is the request's user; without one, it is the key's name, and no person profile is made.
Back to Broadcast overview.