Conversation
…ry model surface - lib/inference-meter: every direct model call records its real token usage and priced cost to inference_calls (fire-and-forget). Turn cost was an estimate in a comment until now. - lib/house-model: ONE Anthropic caller for the chat route + the lint grader. The planner prompt now leads with its stable half (rules + endpoint menu) and PROMPT_CACHE_BREAK; the house caller sends that half as a cached system block (cache reads bill at 0.1x input). - lib/inference-context: a request-scoped key (AsyncLocalStorage), so a BYOK key reaches every call site in the 7k-line chat route. A refused BYOK key never falls back to the house key, and never becomes a house-paid x402 call. - lib/inference-fuse: daily fuses per surface. The free taste lane gets its own fuse so a flood can only exhaust the taste, never paid/earned answers. - markets AI: per-surface daily fuses, IP fence 60 -> 30/h, Plus + BYOK lift. - /api/servers/[slug]/lint: a FRESH run needs a session and draws on a fuse (it was unauthenticated: ~144 runs/day per service, several calls each). - lib/byok: AES-256-GCM sealed Anthropic keys under BYOK_KEY_SECRET, proven with the free count_tokens endpoint before they are stored. - DDL (additive): credit_ledger.pool/grant_key, inference_calls, inference_keys. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…e gate for every house door - lib/plans: Free + Plus ($9/mo, $79/yr, 300 answers). Growth/Scale retired from sale (0 subscribers ever); their ids stay valid so no row can strand. TASTE caps, EARN_CENTS_PER_ANSWER, ANSWER_PACK live here. - lib/billing: the free allowance moves OFF the wallet (free to mint) onto day windows keyed to connection + wallet; a fresh empty wallet gets a guest's taste. PLAN and BANK draw only for a PROVEN owner (session or embed key) — the body's walletAddress could name whose credits to burn before. Separate taste/paid fuses: a flood exhausts the free lane and nothing else. - chat route: one gateHouseAnswer() in front of the manual choke point AND the auto-router and governance turns (both unmetered before). - lib/answer-gate-copy: refusals name what still works and every door out. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A VERIFIED signed receipt banks answers from the fee it paid: 1 per 2 cents of net fee, no floor (a $1 sybil swap earns 0, a $100 swap earns 10). The beacon's valueUsd / buildPath / feeBps are the browser's word, so the grant re-derives both halves from the chain: the tx's `to` must be one of OUR fee-carrying routers (a send or an approval claiming a swap's build path earns nothing), and the notional is min(claimed, what the receipt shows the signer moved). 250 per receipt, 500 per wallet per day, idempotent on the turn id, never for an internal run, never for an attested (non-EVM) verdict. Keyed embed turns bank to the HOST, whose pool their visitors chat on. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ecome an abuse fence
- checkout: { plan: 'plus', interval } (month $9 / year $79) or { pack: true }
($10 one-time, 1,000 answers). Retired plans are refused. With no Stripe
product id set, Stripe creates the product inline, so nothing blocks on a
dashboard step.
- webhook: a PAID pack session grants once (grant key = the session id);
a store error 500s so Stripe redelivers.
- /api/billing/ai-key: session-only save/prefs/delete for a bring-your-own
Anthropic key. Proven with the free count_tokens endpoint, sealed, fenced,
never returned again.
- intent links: the 3/25/unlimited plan caps are gone (links are the growth
loop). A wallet nobody has seen trade keeps 10 live; one verified trade, a
paid plan or an admin wallet mints without limit.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…odel Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ealing, prompt caching, the three gated doors Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… stays on /pricing, two pins corrected inference_calls' first measurements put a house answer at $0.0003-0.0014, not the $0.03 estimate. The maxed-plan rule is now held at 1.5c an answer (10x measured), which sizes Plus at 600 for $9. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pricing v2 — the take rate is the business; a plan prices house answers and nothing else
Nate: "a cheaper version that helps users learn the platform but doesn't get us killed in inference… keep Stripe subscriptions or focus on the transaction fee… maybe let users add their own inference key", then "ok go for what you think we need to do." Memo with the reasoning and the as-built table:
~/yeetful/PRICING-v2-chart-first.md.The model
Fees are unchanged (0.20% organic, 0.50% link).
What it closes
Found in the 09-16 audit of what actually burns inference:
/api/servers/[slug]/lint(no auth at all). OnegateHouseAnswer()now fronts all chat doors; a fresh lint needs a session and draws on a fuse.walletAddressnamed whose credits to burn. Plan and bank answers are now spent only for a PROVEN owner (SIWE session or embed key). An unproven wallet with a bank is told to sign in.valueUsd/buildPath/feeBpsare the browser's word. A real $1 swap could have claimed $1M. The grant re-derives both from the chain:tomust be one of our Uniswap routers, and the notional is min(claimed, what the receipt shows the signer moved). 250 per receipt, 500 per wallet per day.Measured, not guessed
inference_callsrecords tokens and priced cost per model call. First numbers from the harness run: 13 house calls, $0.006 total — $0.0003–0.0014 an answer against the $0.03 every allowance had been sized on. Plus went 300 → 600 on that; the maxed-plan rule is pinned at 1.5¢ (10× measured). The planner prompt now leads with its stable half (rules + endpoint menu) and is sent as a cached system block.Decisions for you (each is a small revert)
inference_calls./pricingsays so.BYOK_KEY_SECRET, never returned, never logged). The alternative was client-held keys, which breaks embeds and links.npm run eval:routingbefore or after merge is your call.Owner steps
BYOK_KEY_SECRET(32+ chars) on Vercel Production. BYOK is OFF and says so until it is set.STRIPE_PRODUCT_PLUS,STRIPE_PRODUCT_PACK. Without them Stripe creates the product inline at checkout.TASTE_GUEST_DAILY=1to the server env (keeps the taste pin to one model call).DDL
Additive, RUN on TEST and PROD:
credit_ledger.pool+grant_key(unique),inference_calls,inference_keys. File:prisma/ddl/2026-09-18-pricing-v2.sql.Gates
tscclean,npm run buildclean.test:api3142 passed / 2 failed, both on main already: the knownrouter selectred, andarc (live)whose pin went stale when Arc's WETH pool got liquidity (A quote is not a price unless the pool can absorb it #820 fixes it). ~45 new pins./pricingdark/light 1440 + 375,/dashboard/plansigned in (mock EIP-6963 + real SIWE) dark 1440 + light 375. 0 horizontal overflow, 0 page errors.🤖 Generated with Claude Code