コンテンツにスキップ
#0702
Exec

The free tier is enforced in front of the code

Your API has a free tier: five hundred calls a month. Your codebase has no billing logic at all.

A hook in front of the API counts each key's calls in shared state. Call five hundred and one gets a 429 with an upgrade link; paid keys pass through untouched. The product code serves requests: it has never heard of tiers.

Raising the limit for a launch weekend is editing a number in a script. Adding a plan is another branch in the same script. None of it touches the product, none of it ships through CI, none of it risks the code that does the actual work.

The pricing page is enforced in front of the code, not inside it.