1. Price
“97% of companies use PostHog for free.”
Free tier: 1M events, 5K session replays, 1M feature flag requests, 100K exceptions, 1500 survey responses per month. As reported on the official pricing page, checked Oct 9, 2026.
posthog.com/pricing2. Commercial use
“Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License.”
Use PostHog Cloud under PostHog's terms; the browser package is Apache-2.0.
github.com/PostHog/posthog-js/blob/main/LICENSE3. Key & sign-up
Project token (write-only) in the request body for capture and flags; personal API key as a Bearer token for private endpoints, or OAuth for apps other PostHog users install. Only the project token is browser-safe; personal API keys are server-only.
posthog.com/docs/settings/projects4. Agent access
“The PostHog Model Context Protocol (MCP) server is a free, hosted endpoint that lets your AI agent use PostHog”
Our agent check: 4 of 6 (Nov 13, 2026).
posthog.com/docs/model-context-protocolChecked against the maker's official pages, pricing on Oct 9, 2026. Tap a verdict to see its source.How we checkedReport an error
What PostHog does
PostHog is an online service that records what people do in your website or app, such as page views, clicks and sign-ups, and turns it into charts. The same account also gives you screen recordings of visits, feature switches for gradual launches, error reports and in-app surveys. Each product has a free monthly allowance; above it you pay per use.
- PostHog is one of 27 APIs in the Error tracking and analytics category on AgentGid.
- It is one of 20 that can be started for free.
- 5 of them ship an official MCP server; PostHog does not.
- Its official SDK is the 2nd most downloaded in the category (40.2M a week).
What people build with it
Find where sign-ups drop off
See how many visitors reach each step from landing page to paid plan, and which step loses the most people.
Watch recordings of confusing screens
Replay real visits to see where people click, scroll and get stuck, for example on a checkout page.
Launch a feature to some users first
Turn a new feature on for 10% of users or for beta testers only, and switch it off without a new release if it breaks.
Catch errors users actually hit
Collect crashes from the browser and the server, then watch the recording of the visit where the error happened.
Quick in-app surveys
Ask a short question inside your app, such as "How likely are you to recommend us?", and see the answers next to usage data.
Track the cost of AI features
Log each call your app makes to an AI model, with tokens used and cost, to see which feature is expensive.
PostHog popularity
SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026.
Pricing
1M events, 5K session replays, 1M feature flag requests, 100K exceptions, 1500 survey responses per month
No monthly plan
Usage-based pricing per product (events, replays, requests, exceptions, responses, etc.)
Added automatically: its SDK was in 90 of the public agent repos we sampled when it was added. Prices read from the official pricing page. The main repo PostHog/posthog is MIT outside ee/ (LICENSE). Privacy policy: PostHog may use customer content, aggregated or de-identified, for training its own models.
What one action costs
| Action | Price |
|---|---|
| 1 analytics event beyond the free 1 million a month (1,000,001 to 2,000,000) | $0.00005 |
| 1 session recording beyond the free 5,000 a month (5,001 to 15,000) | $0.005 |
| 1 feature flag request beyond the free 1 million a month (up to 2,000,000) | $0.0001 |
| 1 exception beyond the free 100,000 a month (100,001 to 325,000) | $0.00037 |
| 1 survey response beyond the free 1,500 a month (1,501 to 2,000) | $0.1 |
Price history
- A year of the pricing page in the Internet Archive (11 months): the lowest monthly figure went from $250 (2025-10) to $250 (2026-08).
- 2026-06: no longer shown $2000/mo
As reported on the official pricing page, checked Oct 9, 2026. Prices change: confirm before you buy. posthog.com/pricing
Limits
240 requests per minute and 1,200 per hour per personal API key
2,400 requests per hour
480 requests per minute and 4,800 per hour
No request-level rate limit
20 MB per request body
From the official docs. posthog.com/docs/api
Key and access
Project token (write-only) in the request body for capture and flags; personal API key as a Bearer token for private endpoints, or OAuth for apps other PostHog users install.
NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN and NEXT_PUBLIC_POSTHOG_HOST (names from the Next.js guide; the packages take the token as an argument)No
Steps only a person can do
- Sign up for PostHog, choose the US or EU cloud, and create a project. Copy the project token and host into .env as NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN and NEXT_PUBLIC_POSTHOG_HOST.
- Decide on cookie consent, recording masking and the model-training opt-out for your users' data. Set opt_out_capturing_by_default or masking options in posthog.init to match that decision.
- Only when you need more than the free allowance, add a card and set a billing limit per product. No code change; the same token keeps working.
- Only for server-side reads (queries, local flag evaluation), create a personal API key with limited scopes. Store it as a server secret, never in browser code.
Commercial use and your data
PostHog Cloud is a paid online service with a free allowance, used under PostHog's terms. The browser package is open source under Apache 2.0, and the main code is MIT outside its "ee" folder if you host it yourself.
Use PostHog Cloud under PostHog's terms; the browser package is Apache-2.0.
“Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License.” source
Shipping posthog-js in your bundle is allowed under Apache-2.0; keep its license and notices.
“Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License.” source
Self-hosted PostHog code is MIT except the ee/ folder, which has its own license.
“All content that resides under the "ee/" directory of this repository, if that directory exists, is licensed under the license defined in "ee/LICENSE".” source
“We may use data you upload or generate through your use of PostHog to help improve PostHog's features and train our own models.”
Events 1 year on free plans and 2 years on pay-as-you-go; longer with platform add-ons.
“Events are retained for 1 year on free plans and 2 years on pay-as-you-go plans.” source
US cloud (Virginia) or EU cloud (Frankfurt).
“Select your cloud US (Virginia) EU (Frankfurt)” source
Errors to handle
PostHog could not tell which project the events belong to.
Check the project token and the region host; do not retry unchanged.
The request body is not valid.
Fix the JSON body (api_key, event and distinct_id fields); do not retry unchanged.
The project token is wrong.
Copy the token again from the project settings.
The personal API key used for a private endpoint is wrong or revoked.
Create or rotate the personal API key and check its scopes.
Events without a name or distinct_id are accepted with 200 and then dropped; over-quota capture also returns 200.
Send event and distinct_id on every event, and check the quota_limited field and ingestion warnings.
Use it from an agent
4 of 6: llms.txt yes, OpenAPI yes, SDK yes, MCP no, status page no, AI assistants allowed yes
Checked Nov 13, 2026.
PostHog MCP server
The server URL is https://mcp.posthog.com/mcp . The PostHog authentication server automatically routes you to the correct data region (US or EU) based on the account you log in with.
npm install posthog-jspip install posthogInstructions in its docs to check first
“Installation: Use the PostHog wizard to install and configure PostHog automatically.”
The page addresses AI coding assistants and points to npx @posthog/wizard@latest, an unpinned package that signs in and changes the project. Ask the person first; prefer the manual setup from the library docs.
“There is also a Claude Code plugin: claude plugin install posthog.”
Installing a plugin changes the person's assistant setup; ask them first.
Alternatives
PostHog This page
Pick Mixpanel when product analytics is the main need; it also offers session replay, experiments and feature flags.
Pick Sentry when error tracking and performance tracing are the main need, with session replay alongside.
Pick GrowthBook when you mainly need feature flags and A/B testing for product teams.
Get started
Tell your AI assistant
“Add PostHog to my Next.js app by hand (no wizard): pin posthog-js, init it with NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN and NEXT_PUBLIC_POSTHOG_HOST, call posthog.identify() after login and posthog.reset() on logout, mask form inputs in replays, and never put a personal API key in browser code.”
Create a PostHog account (US or EU cloud) and copy the project token and host from the project settings.
Install the browser package (or use the HTML snippet from the docs).
npm install --save posthog-jsInitialise it with your token and host; in Next.js read them from public environment variables.
import posthog from 'posthog-js' posthog.init(process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN, { api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST, defaults: '2026-08-30' });
First request
curl -v -L --header "Content-Type: application/json" -d '{
"api_key": "<ph_project_token>",
"event": "event name",
"distinct_id": "user distinct id",
"properties": {
"account_type": "pro"
},
"timestamp": "[optional timestamp in ISO 8601 format]"
}' https://us.i.posthog.com/i/v0/e/{ "status": "Ok" }Mistakes to avoid
A personal API key gives the same access as being logged into your PostHog account.
Blocked requests fail silently and no events arrive.
Requests must go to the domain of the region where the project lives.
posthog-node queues events and sends them in batches; an unflushed queue is lost when the function stops.
The old methods still work during a migration period but are deprecated.
Questions
Is there a free plan?
Yes. Every product has a free monthly allowance that resets each month, and no credit card is needed.
Can the project token be in my website code?
Yes. Capture and flag requests use the project token and return no sensitive data; private data endpoints need a personal key that stays on the server.
Where is my data stored?
In PostHog's US cloud (Virginia) or EU cloud (Frankfurt), whichever you pick, or on your own server if you self-host.
How long is data kept?
Events are kept 1 year on the free plan and 2 years on pay-as-you-go; recordings 1 month on free and 90 days on pay-as-you-go.