Skip to content

Cap the model catalog at $0.02 per decision - #62

Merged
rchasman merged 3 commits into
masterfrom
feat/price-cap
Oct 8, 2026
Merged

rchasman merged 3 commits into
masterfrom
feat/price-cap

Conversation

@rchasman

@rchasman rchasman commented Oct 8, 2026

Copy link
Copy Markdown
Owner

/api/generate-action is open to anyone (no auth, CORS *), so anyone can send provider: "gpt-5.2-pro" in a loop. The client-side maxInstances cap does not stop that. With this change the catalog itself is the spending limit: a model over the ceiling is not in MODELS, so the picker does not offer it and the endpoint rejects it.

Rule

scripts/refresh-models.ts drops any model whose cost for one decision is over $0.02. The decision size is measured: a Dominion buy decision used 3.2k–5.3k input and 36–74 output tokens (nova-micro, opus-5.5-fast, gpt-6.1-sol-fast), and o3-pro used 253. The estimate uses 4k in and 100 out. The filter runs before the class collapse, the same as the denials.

Removed

gpt-5.2-pro, o3-pro, gpt-6-astra and -fast (≈ $0.08 per decision), gpt-5.5-fast, claude-opus-5.5-fast, kimi-k3-fast, gpt-5.5. The gateway also dropped deepseek-v4.1-flash-fast on its own side. The collapse brought back gpt-5.4 and gpt-5.2-fast, which cost $0.012 and $0.017.

Pro preset: claude-opus-5.5-fast → claude-sonnet (5.5), kimi-k3-fast → kimi-k3. The stale gpt-5.5 maxInstances quirk is gone.

Evidence

  • Live, 3 samples each: gpt-5.4, gpt-5.2-fast, kimi-k3, claude-sonnet, gpt-6.1-sol-fast, qwen3.7-max all 3/3 under 10s. gemini-3.1-pro 3/3, max 17.7s.
  • gpt-5.2-pro sent to the local endpoint now fails the request schema ("Invalid request").
  • A new test checks that no catalog model is over the ceiling. Against master's catalog it fails, and it passes on this branch.
  • type, lint, build, test, server, unused, circular and prettier on the changed files all pass.

Dead code

I deleted 1 item: the gpt-5.5 maxInstances quirk, whose model is now gone.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TQLQU5xCLETVSjUSNR4D2s

rchasman and others added 3 commits October 8, 2026 15:43
/api/generate-action is open to anyone, so a model priced past the ceiling
is never offered or accepted. Costs use a measured 4k-in, 100-out decision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TQLQU5xCLETVSjUSNR4D2s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TQLQU5xCLETVSjUSNR4D2s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TQLQU5xCLETVSjUSNR4D2s
@vercel

vercel Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
dominion-maker Ready Ready Preview Oct 8, 2026 4:44am UTC

@rchasman
rchasman merged commit eefc7d3 into master Oct 8, 2026
4 checks passed
@rchasman
rchasman deleted the feat/price-cap branch October 8, 2026 04:46

This branch was successfully deployed

1 active deployment
Preview — f02b517a Deployed Oct 8, 2026 by vercel[bot]
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.

1 participant