HomeAPIs › PostHog

PostHog API — pricing, free tier & how to get a key

PostHog is an all-in-one product analytics platform — event tracking, session replay, feature flags, A/B testing and surveys behind a single API and SDK, open-source with a hosted cloud option. Here's the pricing, the free tier, and how to get started.

PostHog pricing (reference, July 2026)

ProductFree tierBeyond free
Product analytics free tier1M events/mo~$0.00005/event on-demand
Session replay5,000 replays/mo~$0.005/replay on-demand
Feature flags1M requests/mo~$0.0001/request on-demand
Self-hosted (open source)$0 usage feesyou run the infrastructure
⚠️ Reference prices, July 2026 — tiers and per-unit overage rates change and scale down at volume. Confirm on posthog.com/pricing. · Report outdated price →
✓ Last verified: 2026-07-17· Source: official provider pricing page· Auto-monitored — report change →

The free tier

PostHog's free tier is unusually broad: 1 million analytics events, 5,000 session replays and 1 million feature flag requests per month — across the whole platform, not a single crippled product. That's enough for most early-stage products to run real product analytics, watch session replays and ship A/B tests without a credit card. Usage-based pricing kicks in per product past those thresholds, and each product (analytics, replay, flags) is billed separately.

How to get a PostHog API key (step by step)

1. Sign up at posthog.com (US or EU cloud region) or deploy the open-source version yourself.
2. Create a project — PostHog generates a Project API Key immediately, shown in Project Settings.
3. Add the JavaScript snippet (or a framework SDK: React, Next.js, Python, etc.) to your app with that key.
4. For server-side/REST API access (querying data programmatically), create a Personal API Key under Settings → Personal API Keys.

Minimal JavaScript init:

// npm install posthog-js
import posthog from "posthog-js";
posthog.init("phc_your_project_api_key", { api_host: "https://us.i.posthog.com" });

Cheaper / alternative options

Mixpanel has a smaller free tier (20M events/mo but fewer bundled features) and is analytics-only. Amplitude is enterprise-focused and typically pricier at scale. Self-hosting PostHog (it's open source) removes usage fees entirely but shifts cost to running and scaling ClickHouse/Postgres yourself — worth it only past meaningful volume. For error tracking rather than product analytics, see Sentry.

FAQ

Does PostHog have a free tier?

Yes — 1M analytics events, 5,000 session replays and 1M feature flag requests per month, free, across the whole platform.

How do I get a PostHog API key?

Create a project at posthog.com and copy the Project API Key from Project Settings; use a separate Personal API Key for server-side REST calls.

Is PostHog or Mixpanel cheaper?

PostHog's combined free tier (analytics + replay + flags) is more generous overall; Mixpanel's raw event free allowance is larger but covers analytics only. Model your real event volume on each vendor's calculator.

Can I self-host PostHog for free?

Yes — PostHog is open source and self-hosting removes usage-based fees, but you take on running and scaling the underlying infrastructure yourself.

Not affiliated with PostHog. Prices are reference estimates — always verify on the official pricing page.

Host your project:DigitalOcean — $200 free ↗Hostinger VPS

Exchanges

BybitBinanceOKXKuCoinBitgetGate.ioMEXC

Tools & Hosting

📈 TradingView🔒 NordVPN💳 RevolutDigitalOcean $200Hostinger