How to Integrate Helicone with PostHog

1

Sign up for PostHog

Create an account for PostHog here.

2

Add two new headers

Similar to how you set Helicone-Auth header, add two new headers Helicone-Posthog-Key and Helicone-Posthog-Host with your API key and PostHog host.

You can find both your API key and PostHog host in your PostHog project settings.

client = OpenAI(
	api_key="<your-api-key-here>", # Replace with your OpenAI API key
	base_url="https://oai.hconeai.com/v1" # Set the API endpoint
	default_headers= {
		"Helicone-Auth": f"Bearer {HELICONE_API_KEY}",
		"Helicone-Posthog-Key": "<ph_project_api_key>",
		"Helicone-Posthog-Host": "<ph_client_api_host>",
	}
)

Helicone events will now be exported into PostHog as soon as they’re available.

3

Create a dashboard in PostHog

Create your own dashboard, or use our template to start.

  1. Go to the dashboard tab in PostHog.
  2. Click the New dashboard button in the top right.
  3. Select LLM metrics – Helicone from the list of templates, or Blank dashboard to start from scratch.