Skip to content

docs: add PostHog Code pricing page#18457

Merged
adboio merged 9 commits into
masterfrom
docs/posthog-code-pricing-clean
Jul 14, 2026
Merged

docs: add PostHog Code pricing page#18457
adboio merged 9 commits into
masterfrom
docs/posthog-code-pricing-clean

Conversation

@annikaschmid

@annikaschmid annikaschmid commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Changes

Adds a PostHog Code pricing page at /docs/posthog-code/pricing, modeled on the PostHog AI pricing page, plus a "Pricing" nav entry under the PostHog Code docs section.

What the page covers

  • Billing model — usage-based AI credits, 100 credits = $1, no markup (unlike PostHog AI)
  • $20 monthly free tier
  • Model pricing table — input/output cost per 1M tokens, in AI credits, for all currently available models
  • What consumes credits — every interaction (writing code, querying PostHog data, ad-hoc questions)
  • How usage works — token-based, pick any model/harness
  • Tracking — in-app Plan & usage tab (real-time, by day and model) with screenshots, plus billing pages (24h delay)
  • Controls — $50 default billing limit (extendable), custom limits, usage alerts, behavior when the limit is hit

Model prices

The per-1M-token prices are filled in and shown in AI credits (100 credits = $1), consistent with how usage is billed. The values are the pass-through provider rates the LLM gateway bills againstMODEL_COST_OVERRIDES in services/llm-gateway plus LiteLLM's live cost map (and the Cloudflare resold rate for glm-5.2) — so they match what customers are actually charged. Since these track the underlying providers, they may drift over time and should be re-checked against the gateway if provider rates change.

🤖 Generated with Claude Code

annikaschmid and others added 2 commits July 14, 2026 14:02
Add a pricing page for PostHog Code modeled on the PostHog AI pricing
page, plus a nav entry under the PostHog Code section.

Covers: AI credit billing (100 credits = $1, no markup), $20 monthly
free tier, $50 default billing limit, what consumes credits, in-app
Plan & usage tracking, and billing controls.

Per-1M-token model prices in the table are still TBD (cells left empty).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Deploy preview

Status Details Updated (UTC)
🟢 Ready View preview Jul 14, 2026 05:11PM

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Vale prose linter → found 2 errors, 0 warnings, 0 suggestions in your markdown

Full report → Copy the linter results into an LLM to batch-fix issues.

Linter being weird? Update the rules!

contents/docs/posthog-code/pricing.mdx — 2 errors, 0 warnings, 0 suggestions
Line Severity Message Rule
54:81 error Use straight quotes and apostrophes, not curly ones. PostHogDocs.CurlyQuotes
89:4 error Use straight quotes and apostrophes, not curly ones. PostHogDocs.CurlyQuotes

- Simple, short tasks use very few tokens, and therefore very few credits.
- More complex tasks that span many files or multiple iterations use more tokens and consume more credits.
- Because we charge no markup, your credits reflect exactly what the underlying model costs.
- You can pick [any model and any harness](/docs/posthog-code/use-any-model-and-harness), so you're free to choose a cheaper model for simpler tasks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 confidence for smart model routing as a future feature so this decision burden is not so much on the user.

- **Default & custom billing limit:** PostHog sets a default **$50 billing limit** so you don't accidentally rack up costs without a ceiling. You can customize your billing limit at any time.
- **Usage alerts:** Get notified when you hit key thresholds

When you reach your billing limit, you won't be able to send messages until you raise it. Increase your billing limit to continue using PostHog Code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if you reach your limit mid-turn?
Will it complete the original prompt (and therefore allow a bit of overage), or will it fail (and thus I need to restart the query after adjusting billing?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would fail right now. The billing limit logic is not real time for now since it's sitting in billing and only updated once a day, so this is a real edge case.

I asked for details on Slack.

Comment thread contents/docs/posthog-code/pricing.mdx Outdated

- **Real-time tracking:** See costs as you go
- **Default & custom billing limit:** PostHog sets a default **$50 billing limit** so you don't accidentally rack up costs without a ceiling. You can customize your billing limit at any time.
- **Usage alerts:** Get notified when you hit key thresholds

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this set by the user? Or do we have preset "key thresholds"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the automatic billing emails. We email users when 80% and 100% of their free tier limit, and 80% and 100% of their billing limit, if one is set.

Since the usage-based pricing product will be set up like any other usage-based product, this would work. (At least Joe and I think that).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! maybe just adjust that for clarity for the reader – that they're automated emails.

Comment thread contents/docs/posthog-code/pricing.mdx Outdated

## Model pricing

For reference, the table below shows model costs **per 1M tokens**:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We say credits above, it's a bit unclear how that maps to tokens

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. Once I have the values, I can do something like

| gpt-5.6-sol | 1,000 credits ($10) | — |

Populate the per-1M-token input/output prices for all models in the
PostHog Code pricing table, replacing the "—" placeholders. Numbers
are the pass-through provider rates the LLM gateway bills against
(MODEL_COST_OVERRIDES plus LiteLLM's cost map / Cloudflare resold rate
for glm-5.2), so they match what customers are actually charged.

Generated-By: PostHog Code
Task-Id: 67ede8c6-9e4f-404a-b5c7-a597e3d3f401
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Bundle report

Total JS (gzip)

6.30 MiB (+0.2 KiB / +0.0%)

Eager graph (modules shipped in each entrypoint's initial chunks)

Entrypoint Eager size Budget Modules
app 15.57 MiB (+0.9 KiB / +0.0%) report-only 1941
Largest modules in the app closure
Module Size
css ./node_modules/.pnpm/css-loader@5.2.7_webpack@5.101.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[1]!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.5.6_webpack@5.101.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[2]!./src/styles/global.css 709.8 KiB
./src/components/Stickers/Stickers.tsx 696.4 KiB
./.cache/caches/gatsby-plugin-mdx/mdx-scopes-dir/31a094f140f119e73085d847ae81b99b.js + 2 modules 615.0 KiB
./node_modules/.pnpm/@radix-ui+react-icons@1.3.2_react@18.3.1/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js 481.4 KiB
./node_modules/.pnpm/rehype-raw@7.0.0/node_modules/rehype-raw/lib/index.js + 29 modules 395.1 KiB
./node_modules/.pnpm/@posthog+icons@0.36.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.cjs.js 364.8 KiB
./src/hooks/useCustomers.tsx + 54 modules 355.1 KiB
./node_modules/.pnpm/@posthog+icons@0.36.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js 354.8 KiB
./node_modules/.pnpm/react-markdown@8.0.7_@types+react@16.14.66_react@18.3.1/node_modules/react-markdown/lib/react-markdown.js + 88 modules 351.4 KiB
./node_modules/.pnpm/cloudinary-core@2.14.0_lodash@4.17.21/node_modules/cloudinary-core/cloudinary-core.js 281.9 KiB
./src/components/ProductComparisonTable/index.tsx + 120 modules 278.5 KiB
./node_modules/.pnpm/d3@7.9.0/node_modules/d3/src/index.js + 208 modules 247.4 KiB
./src/components/Pricing/PricingSlider/Slider.tsx + 87 modules 239.9 KiB
./gatsby-browser.tsx + 41 modules 239.8 KiB
./src/components/SearchUI/index.tsx + 73 modules 223.4 KiB

Eager-graph budgets are report-only until a baseline is established. Sizes are gzip of public/**/*.js; eager size is webpack module source bytes for the modules actually shipped in the entrypoint's initial chunks (post-tree-shake).

Comment thread contents/docs/posthog-code/pricing.mdx Outdated

- **Real-time tracking:** See costs as you go
- **Default & custom billing limit:** PostHog sets a default **$50 billing limit** so you don't accidentally rack up costs without a ceiling. You can customize your billing limit at any time.
- **Usage alerts:** Get notified when you hit key thresholds

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Usage alerts:** Get notified when you hit key thresholds
- **Usage alerts:** You'll receive automatic emails to let you know when you use 80% and 100% of the free tier, and 80% and 100% of the billing limit (if one is set).

Drop the parenthetical USD amounts from the model pricing table so it
reads in AI credits only, consistent with how usage is billed.

Generated-By: PostHog Code
Task-Id: 67ede8c6-9e4f-404a-b5c7-a597e3d3f401
@adboio
adboio merged commit 9d4a8ca into master Jul 14, 2026
19 checks passed
@adboio
adboio deleted the docs/posthog-code-pricing-clean branch July 14, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants