> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # What you actually get when you pay for a feature flag Canonical URL: https://posthog.com/docs/billing/what-you-pay-for-per-feature-flag > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://app.posthog.com` (app host for links). ## On this page - [The price](#the-price) - [What happens to one flag request](#what-happens-to-one-flag-request) - [If you build it yourself](#if-you-build-it-yourself) - [Costs that arrive later](#costs-that-arrive-later) - [Your own ledger](#your-own-ledger) - [When building is the right call](#when-building-is-the-right-call) - [Common questions](#common-questions) - [How to lower your PostHog bill](#how-to-lower-your-posthog-bill) In PostHog your first 1 million feature flag requests are free every month. After that, you pay per request and the price per request drops as you make more – this helps ensure a busy app doesn't end up with a massive bill. [Experiments](https://posthog.com/docs/experiments.md) use the same requests and the same free tier, so there's no separate price for running a test. This is [how we think pricing should be](https://posthog.com/handbook/engineering/feature-pricing.md) in order for it to be fair for you and successful for us. The price per request covers more than just an on/off switch. It covers answering fast on every page load, giving each user the same answer every time, targeting on what you know about your users, keeping your product working when something fails, changing flags safely, and seeing what each flag did. It also covers the continuing investment into keeping our feature flags platform running smoothly and growing the features within it. And when the flag service has a bad day, our engineers get paged, not yours. A basic flag is the easy part. A table of flag keys and an `if` statement in your code will do, and an AI agent can write that in an afternoon – though it's much easier and also free to get started with PostHog. Our post on [whether to build or buy feature flags](https://posthog.com/blog/build-or-buy-feature-flags.md) covers the wider trade-off if you want to dig into that in detail. Every section starts in plain English and ends with the technical detail, so you don't need to be an engineer to follow it. > **No bill yet?** Every PostHog product has a free tier, and they're big enough that 97% of users never pay us a penny. If you make fewer than 1 million flag requests a month, it is always easier and cheaper to start with PostHog. ## The price You pay per request, not per flag. A request is one call to our `/flags` endpoint, which returns the value of every flag that applies to a user. Your app makes a request when the SDK loads, when a user logs in or their properties change, or when your server checks a flag. A request that evaluates 50 flags costs the same as a request that evaluates one even though they carry different amounts of data – we think this helps keep pricing simpler. Below are the live rates for [Feature Flags](https://posthog.com/feature-flags.md). Feature flags & Experiments bills per request. The first 1,000,000 requests each month are free. The price per request drops as volume grows. Prices for every product are in [pricing.md](https://posthog.com/pricing.md). | Monthly volume | Price per request | | --- | --- | | First 1,000,000 | Free | | 1,000,001 – 2,000,000 | $0.0001 | | 2,000,001 – 10,000,000 | $0.000045 | | 10,000,001 – 50,000,000 | $0.000025 | | Above 50,000,000 | $0.00001 | A request that doesn't evaluate any active, billable flag isn't charged. The `$feature_flag_called` events your SDK sends for usage charts aren't flag requests either. [Cutting feature flag costs](https://posthog.com/docs/feature-flags/cutting-costs.md#understanding-your-bill) explains what counts. [Local evaluation](https://posthog.com/docs/feature-flags/local-evaluation.md) on your servers bills differently. Each time a server downloads your flag definitions, it counts as 10 requests – or as 1 request if nothing changed since the last download and your [SDK version sends ETags](https://posthog.com/docs/feature-flags/cutting-costs.md#reducing-local-evaluation-costs). The flag checks your server then makes in memory are free. A check that falls back to a `/flags` request is billed like any other request. > Asking [PostHog AI to create or change a flag](https://posthog.com/docs/feature-flags/manage-flags-ai.md) spends [AI credits](https://posthog.com/docs/posthog-ai/pricing.md). [Approvals](https://posthog.com/docs/settings/approvals.md) for flag changes are part of the Scale and Enterprise [platform packages](https://posthog.com/pricing.md). Those are the only line items. We don't charge per flag, per seat, per rollout change, or per experiment, so your whole team can create and change as many flags as they need. ## What happens to one flag request A feature flag system has the same jobs whether you buy it or build it. It has to answer before the page needs it, give each person the same answer every time, and know enough about that person to target them. It has to keep your product working when it can't answer. Then your team needs a safe way to change flags, and a way to see what each flag did. In practice that's six steps. ### Step 1: Answering on every page load Your customer opens your pricing page. Before the page can decide which version to show, it needs to know which flags are on for this person. The page waits for that answer, and the same check happens on every page load, for every user, at your busiest hour. **How it works at PostHog:** Flags are served by a dedicated [service written in Rust](https://github.com/PostHog/posthog/tree/master/rust/feature-flags), separate from the rest of PostHog. Flag definitions are cached in Redis, with S3 and then Postgres behind it if the cache misses. For each request, the service fetches the person's properties in one query, then evaluates every flag in memory, in parallel. We [rewrote it from Django](https://posthog.com/blog/even-faster-more-reliable-flags.md) for this, and it now serves about 13,000 requests per second with a p99 under 100 ms ([how we got there](https://posthog.com/blog/untangling-rayon-and-tokio.md)). On your servers, [local evaluation](https://posthog.com/docs/feature-flags/local-evaluation.md) skips the network for each check. The SDK downloads your flag definitions every 30 seconds by default (every 5 minutes in Go) and evaluates flags in memory. It's available in 10 server-side SDKs. Definition downloads run on their own servers, apart from the ones that answer `/flags`, and when nothing has changed we reply `304 Not Modified` with no data at all. If the SDK can't evaluate a flag in memory, it sends a normal `/flags` request instead, and we bill that request. This happens when you don't pass a property that the flag's conditions use, or when the server just started and has no definitions yet. To stop this, turn on the [local-only option](https://posthog.com/docs/feature-flags/local-evaluation.md#step-3-evaluate-your-feature-flag) (`onlyEvaluateLocally` in Node.js). The SDK then returns no value instead of making a request. Without it, every flag check waits on a database query, and the page waits with it. This is a major reason why it can make more sense to use PostHog than to build your own flags. Anything you build yourself is something you then have to keep fast as your traffic grows. ### Step 2: Giving the same answer every time You roll out a new checkout to 20% of users. Someone in that 20% sees it on Monday, comes back on Tuesday, and should see it again. When you widen the rollout to 50%, the people who already had it should keep it. If they flip back and forth, your support team hears about it, and your experiment results are wrong. **How it works at PostHog:** Each flag hashes the flag key and the user's ID with SHA-1, and turns the result into a number between 0 and 1. If that number is below the rollout percentage, the user gets the flag. The same inputs always give the same answer, so a rollout needs no stored list of who got what, and widening it only adds people. The flag key is part of the hash, so a user's place in one flag doesn't decide their place in another. Variants use a second hash. [Best practices](https://posthog.com/docs/feature-flags/best-practices.md#how-the-hash-works) shows the full formula. The hardest case is a user who logs in partway through a visit, because their ID changes. [Device bucketing](https://posthog.com/docs/feature-flags/device-bucketing.md) hashes on the device ID instead, which stays the same through login. [Experience continuity](https://posthog.com/docs/feature-flags/stable-identity-for-flags.md) stores an override when the ID changes, so the value they had before login carries over. Without it, a user can see the old checkout before login and the new one after, and nobody can tell you why. ### Step 3: Knowing who's asking "Turn this on for enterprise customers in Europe who signed up after January" is a normal request. (Give it a month and someone will ask for one that's more specific.) To answer it, the flag needs to know the person's plan, country, and signup date at the moment it's checked, including properties they got one second ago. **How it works at PostHog:** Flags target on [person and group properties](https://posthog.com/docs/feature-flags/user-and-group-targeting.md), [cohorts](https://posthog.com/docs/data/cohorts.md), and [other flags](https://posthog.com/docs/feature-flags/dependencies.md). They read the same people and properties that your [events](https://posthog.com/docs/billing/what-you-pay-for-per-event.md) already build, so there's no second user database to keep in sync. Cohort membership is cached in the service, so cohort targeting is as fast as a property check. When your app sets a new property, client SDKs send it with the next request as a [property override](https://posthog.com/docs/feature-flags/property-overrides.md), so the flag doesn't wait for ingestion to catch up. [Evaluation contexts](https://posthog.com/docs/feature-flags/evaluation-contexts.md) limit each flag to the apps and environments it belongs to. Without it, every targeting rule needs a copy of your user data inside the flag system, and that copy is always a little out of date. ### Step 4: Not breaking your product when something fails Networks drop and ad blockers block requests. When the flag service doesn't answer, your product still has to load, and it has to show something sensible. **How it works at PostHog:** Most SDKs wait 3 seconds by default, then stop waiting and carry on. When a response comes back with only some flags, the SDK updates those and keeps the last known values for the rest. [Bootstrapping](https://posthog.com/docs/feature-flags/bootstrapping.md) lets you send flag values with the page, so the first render doesn't wait for a request at all. On your servers, local evaluation keeps working from cached definitions when PostHog can't be reached, and the safe defaults you set cover a cold start. If you go over a [billing limit](https://posthog.com/docs/feature-flags/cutting-costs.md#quota-limiting), flags return their default values instead of errors. Your code still has to handle a flag that hasn't loaded yet. [Best practices](https://posthog.com/docs/feature-flags/best-practices.md) explains how. Without it, when your flag service goes down, your product goes down with it, and someone on your team gets paged at 2 am. ### Step 5: Changing a flag safely Your product manager wants to widen a rollout on Friday afternoon (brave, but it happens). Your support lead wants to turn a feature on for one customer. Neither of them should need a deploy, and both should be able to see who changed what, and when. **How it works at PostHog:** The [web app](https://posthog.com/docs/feature-flags/surfaces/web-app.md) handles boolean, multivariate, and [remote config](https://posthog.com/docs/feature-flags/remote-config.md) flags, with [payloads](https://posthog.com/docs/feature-flags/creating-feature-flags.md), release conditions, and a test view that shows how a flag evaluates for one user. You can [schedule changes](https://posthog.com/docs/feature-flags/scheduled-flag-changes.md), including recurring ones, and see roughly how many users a change will affect before you make it. Every flag has an activity log of who changed what. The same actions work from the [MCP server](https://posthog.com/docs/feature-flags/surfaces/mcp.md) and the [API](https://posthog.com/docs/feature-flags/surfaces/api.md), and calling the MCP tools is free. Without it, every flag change is a pull request, or a database edit with no history. ### Step 6: Knowing what a flag did You shipped the new checkout to half your users. Now you want to know who saw it, whether they converted, and whether anything broke for them. **How it works at PostHog:** Each flag has a [Usage tab](https://posthog.com/docs/feature-flags/surfaces/web-app.md#see-how-a-flag-is-used) that shows how often your code checked it and which values it returned. [Experiments](https://posthog.com/docs/experiments.md) run on the same flags and bill as flag requests. Because flags share people with the rest of PostHog, you can see the [session replays](https://posthog.com/docs/session-replay.md), events, and [errors](https://posthog.com/docs/error-tracking.md) from the people who got a flag, and [start recording](https://posthog.com/docs/session-replay/how-to-control-which-sessions-you-record.md) only when a flag is on. When a flag has done its job, [stale flag cleanup](https://posthog.com/docs/feature-flags/cleaning-up-stale-flags.md) finds flags nothing has checked in 30 days, or that have been fully rolled out for 30 days. Without it, you know a flag is on but not whether it helped. ## If you build it yourself Every one of those jobs still exists when you run flags yourself. This table shows what each one looks like on both sides. The second column is what we run for you, the third is what you'd run instead, and the last is when the job needs time from your team. | Job | What PostHog runs | What you run instead | When it needs your team | | --- | --- | --- | --- | | Answering fast | A Rust flags service, a Redis, S3, and Postgres cache, and local evaluation in 10 server-side SDKs | An API, a cache, and a database of flag rules, close to every app that checks flags | When traffic peaks or the database slows down | | Giving the same answer | Deterministic hashing, device bucketing, and experience continuity | A hashing scheme that every SDK and service implements the same way | When a user logs in partway through a visit, or one SDK hashes differently | | Knowing who's asking | Targeting on person and group properties, cohorts, and other flags, from the people your events already build | A copy of your user data in the flag system, and a way to keep it current | When someone asks to target a new property | | Not breaking your product | SDK timeouts, partial responses, bootstrapping, and cached definitions | Timeouts, defaults, and fallback logic in every app | When the flag service is down | | Changing flags safely | A web app, scheduled changes, an activity log, MCP, and an API | An admin UI, permissions, and an audit log | When someone outside engineering needs to change a flag | | Knowing what it did | Usage charts, experiments, and links to replays, events, and errors | Logging, a connection to your analytics, and a stats engine | When someone asks whether the feature worked | ## Costs that arrive later A first build covers a table of flags and a function that reads it. The costs below show up once it's in production, so estimates often leave them out, whether a person or an agent writes them. ### The flag service is in your critical path If your pages wait for flags, any slowdown in your flag service slows your product too. The service has to be sized for your busiest hour. Our [October 2025 outages](https://posthog.com/handbook/company/post-mortems/2025-10-21-feature-flags-recurring-outages.md) show how that can go wrong, even for a team that works on flags full time. Some failures are quieter. In [February 2026](https://posthog.com/handbook/company/post-mortems/2026-02-06-feature-flags-cache-degradation.md), a cache backlog meant flag changes were slow to take effect, and there were no errors to warn anyone. ### Consistency bugs don't cause errors A hashing difference between two SDKs, or an ID that changes at login, doesn't crash anything. It shows a user the wrong version, and it skews your experiment results. Someone has to notice, and then someone has to find the cause. ### Targeting needs your user data Every new targeting rule needs data your flag system may not have: a plan, a company size, or a cohort of users who did something last week. Each one is another sync to build, and another place where data can be out of date. In PostHog, [the events you already send](https://posthog.com/docs/billing/what-you-pay-for-per-event.md) do this job. ### Old flags stay in your code A flag that has done its job stays in your code until someone removes it. Each forgotten flag is a branch in your code that nobody tests. Without usage data, you can't tell which flags are safe to remove. ### Time and trust The rest is the same as for events. There are the [hours your team doesn't spend on your product](https://posthog.com/docs/billing/what-you-pay-for-per-event.md#time-you-dont-spend-on-your-product), and the controls your own build would need to match: [SOC 2](https://posthog.com/docs/privacy/soc2.md), [HIPAA](https://posthog.com/docs/privacy/hipaa-compliance.md), and a public [status page](https://posthog.com/status.md). Flags decide what your users see, so the system that serves them needs the same care as the rest of your product. ## Your own ledger This is where you do the math. You'll want an engineer for the technical rows, but anyone can fill in the rest. If an agent is helping with your estimate, ask it to fill this in too and say where each number came from. | Input | Your number | Notes | | --- | --- | --- | | Flag requests per month | | Your [billing page](https://app.posthog.com/organization/billing) shows it, or [estimate it](https://posthog.com/docs/billing/estimating-usage-costs.md#how-do-i-estimate-the-number-of-feature-flag-requests) | | Regions | | Every region where your users need a fast answer | | Service compute per region | | The servers that answer flag requests, sized for your busiest hour | | Cache and database | | Where flag rules and user properties live | | User data sync | | Keeping properties and cohorts current in the flag system | | Engineer hours per month | | SDK updates, admin UI requests, and debugging flags that gave the wrong answer | | On-call | | Who, and what it costs them | In plain English, add up the servers, the data, and the people, then divide by the number of requests you make. As a formula: ``` monthly total = (compute per region × regions) + cache and database + user data sync + (engineer hours × loaded rate) + on-call your cost per request = monthly total ÷ flag requests per month ``` Compare the last line with [a PostHog bill](https://posthog.com/pricing.md) at the same volume. Take the Feature Flags total from the pricing calculator and divide it by your monthly requests. The free million and the falling tiers mean that average comes out lower than the rates at the top of this page. If an agent is doing the math, point it at our [pricing guide for agents](https://posthog.com/pricing/agent-estimates.md). The ledger leaves out the costs you can't put a price on, like a slower page, a user who sees the wrong version, and an experiment result you can't trust. ## When building is the right call Building your own flags is the better choice for some teams. These are the cases where we'd build it too. **You only need a few on/off switches.** If your flags are a handful of kill switches that only change once a month and apply to everyone universally then a config file or an environment variable will do. You can skip most of this page, because you don't need targeting, rollouts, or experiments. **Flag checks can never leave your infrastructure.** If a policy says that no request may go to a third party, you need flags you host yourself. Check first whether [local evaluation](https://posthog.com/docs/feature-flags/local-evaluation.md) meets the policy: your servers download flag rules from PostHog, then check flags without a request for each user. If you're not sure which side you're on, fill in the ledger. For more on the trade-off, see our post on [building or buying feature flags](https://posthog.com/blog/build-or-buy-feature-flags.md). ## Common questions ### Does PostHog charge per flag or per seat? No. You pay per request to the `/flags` endpoint. A request costs the same whether it evaluates one flag or 50, and seats are free. Experiments bill as flag requests too. ### Do `$feature_flag_called` events count as flag requests? No. They're the events that build each flag's usage charts, and they don't add to your flag bill. [Cutting feature flag costs](https://posthog.com/docs/feature-flags/cutting-costs.md#understanding-your-bill) explains what counts. ### Is local evaluation cheaper? Often, for servers that check flags many times. Each server pays for its downloads of flag definitions, not for each check: 10 requests when the definitions changed, and 1 when they didn't if your [SDK version sends ETags](https://posthog.com/docs/feature-flags/cutting-costs.md#reducing-local-evaluation-costs) – older SDK versions pay 10 either way. For example, one server that downloads every 30 seconds makes about 86,400 downloads a month. To estimate your own cost, use your SDK's interval. Go downloads every 5 minutes by default, and PHP doesn't download on a timer. More servers multiply that, so [share one cache](https://posthog.com/docs/feature-flags/local-evaluation/distributed-environments.md) between them. A flag that the SDK can't evaluate in memory falls back to a billed `/flags` request, unless you turn on the [local-only option](https://posthog.com/docs/feature-flags/local-evaluation.md#step-3-evaluate-your-feature-flag). ### Is it cheaper to build my own feature flags? A table and an `if` statement cost almost nothing. Most of the cost is the work around them: fast answers, the same hashing in every SDK, targeting on current user data, fallbacks, and a UI for your team. The [ledger](#your-own-ledger) works it out with your numbers. ## How to lower your PostHog bill If you want to keep using PostHog but pay less, these changes help most. - [Reduce client-side requests](https://posthog.com/docs/feature-flags/cutting-costs.md#reducing-client-side-feature-flag-requests). Skip the request on first load when you call `identify()` straight after, or [bootstrap](https://posthog.com/docs/feature-flags/bootstrapping.md) flags from your server. - On servers, use [local evaluation](https://posthog.com/docs/feature-flags/cutting-costs.md#reducing-local-evaluation-costs) with an SDK version that sends ETags, and share definitions across instances. - Turn off flag requests in [test and CI environments](https://posthog.com/docs/feature-flags/cutting-costs.md#configuring-test-and-ci-environments). - Set a [billing limit](https://posthog.com/docs/billing/limits-alerts.md) so you know the most you'll pay in a month. If you'd like help with your setup, [talk to us](https://posthog.com/talk-to-a-human.md).