Skip to content

feat(llm-gateway): drop posthog_code free valve to $20 - #70947

Merged
adboio merged 1 commit into
masterfrom
posthog-code/gateway-free-valve-20
Jul 15, 2026
Merged

feat(llm-gateway): drop posthog_code free valve to $20#70947
adboio merged 1 commit into
masterfrom
posthog-code/gateway-free-valve-20

Conversation

@adboio

@adboio adboio commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Problem

Free-tier posthog_code users are capped at $75/day. Under usage-based billing the org-level free allowance is $20/month, enforced through the quota pipeline within ~20 minutes, so the per-user cap only has to bound burn inside that window. $75 is far past the thing it protects.

Changes

FREE_PLAN_COST_LIMIT drops to $20 burst/day and $20 sustained/30d, matching the org allowance so one user can't burn past an org's month alone. Takes effect for free-tier users on deploy.

How did you test this code?

Existing free-cap boundary tests moved to the new value ($20 blocks, $19 sustained allowed). Full gateway suite green.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Docs update

None.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

PostHog Code session (Claude). Skill: /writing-tests.


Created with PostHog Code

adboio commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@trunk-io

trunk-io Bot commented Jul 15, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@adboio
adboio requested a review from a team July 15, 2026 03:35
@adboio
adboio marked this pull request as ready for review July 15, 2026 03:35
@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested a review from a team July 15, 2026 03:36
@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(llm-gateway): drop posthog_code fre..." | Re-trigger Greptile

@adboio
adboio force-pushed the posthog-code/gateway-free-valve-20 branch from b661233 to 7feec83 Compare July 15, 2026 03:50
@adboio
adboio force-pushed the posthog-code/gateway-org-subscription-cap branch from 441e610 to 37af628 Compare July 15, 2026 03:53
@adboio
adboio force-pushed the posthog-code/gateway-free-valve-20 branch 2 times, most recently from eb69e21 to 7fa79f5 Compare July 15, 2026 04:28
@adboio
adboio force-pushed the posthog-code/gateway-free-valve-20 branch 2 times, most recently from 12911a4 to b97596c Compare July 15, 2026 14:51
@adboio
adboio changed the base branch from posthog-code/gateway-org-subscription-cap to graphite-base/70947 July 15, 2026 15:19
@adboio
adboio force-pushed the posthog-code/gateway-free-valve-20 branch from b97596c to d5214fa Compare July 15, 2026 15:20
@adboio
adboio force-pushed the graphite-base/70947 branch from 87329f6 to 5ec77d2 Compare July 15, 2026 15:20
@graphite-app
graphite-app Bot changed the base branch from graphite-base/70947 to master July 15, 2026 15:21
The per-user free-plan cap is an abuse valve, not billing logic: the
org-level monthly free allowance (billing's free plan, enforced through the
quota pipeline) is the real ceiling for non-paying orgs. $20 matches that
allowance, so no single user can burn past the org's entire month alone -
the valve only has to bound burn during the quota pipeline's ~20-minute
blocking lag.

Plain constant on purpose: nothing needs a no-deploy flip here (the valve
has no ordering relationship with the seat-deletion cutover), so a settings
knob would be machinery without a load. Changing the number again is a
one-line PR.

Generated-By: PostHog Code
Task-Id: e6d23925-2a64-452b-aeea-fd349077f904
@adboio
adboio force-pushed the posthog-code/gateway-free-valve-20 branch from d5214fa to 49b3ef5 Compare July 15, 2026 15:21
@adboio
adboio merged commit f5489f6 into master Jul 15, 2026
171 checks passed

adboio commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

@adboio
adboio deleted the posthog-code/gateway-free-valve-20 branch July 15, 2026 15:36
@deployment-status-posthog

deployment-status-posthog Bot commented Jul 15, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-07-15 16:16 UTC Run
prod-us ✅ Deployed 2026-07-15 16:37 UTC Run
prod-eu ✅ Deployed 2026-07-15 16:37 UTC Run

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