Skip to content

Price selectable models from the markdown table - #199

Merged
oakimov merged 15 commits into
mainfrom
cursor/selectable-variant-pricing-7d91
Nov 20, 2026
Merged

oakimov merged 15 commits into
mainfrom
cursor/selectable-variant-pricing-7d91

Conversation

@oakimov

@oakimov oakimov commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Use published Fast and long-context token rates in the OpenCode catalog and in the provider’s cost estimates. The generator uses the Cursor pricing table first, then the Cursor model page for missing rates, then supported fallbacks to the provider’s official pricing. Context windows come from the Cursor model reference.

  • Fast selections with a distinct published rate get their own -fast model. Reselect saved Fast variants that moved from the base model to a dedicated entry.
  • Standard and Fast long-context prices are checked independently. Missing required prices stop generation before the existing file is written. Auto (default) remains the sole intentional unpriced entry because its rate can vary by route and plan. Cursor Auto pricing

Selected rates

Rates are USD per million tokens. The threshold applies once the prompt exceeds the listed size.

Selection Input Cache write Cache read Output
GPT-5.5 Fast $12.50 — $1.25 $75
GPT-5.5 above 272k $10 — $1 $45
GPT-5.6 Sol Fast above 272k $16 $20 $1.60 $60
Claude Fable 5.2 Fast $16 $20 $0.40 $80
GPT-5.2 Fast and GPT-5.3 Codex Fast $3.50 — $0.35 $28
Gemini 3.1 Pro through 200k $2 — $0.20 $12
Gemini 3.1 Pro above 200k $4 — $0.40 $18

Cursor’s model pages supply the GPT-5.5 and GPT-5.6 rates. The provider fallbacks use Anthropic Fast mode, the OpenAI Fast tier, and Google’s Gemini 3.1 Pro Standard tier. Gemini 3.1 Pro gets its 200k pricing threshold even though Cursor advertises it as a single 1M model entry. Generated rates · Google pricing

Offline generation

Supply both --from-file and --context-from-file for a fully offline run. Save required Cursor pages as <model-id>.html in --pages-from-dir. Save provider inputs as anthropic.html, openai.html, or google.md in --provider-pages-from-dir as required. Required Cursor pages are validated before provider fallback. The saved fixtures reproduce the generated file byte for byte regardless of local input paths.

Verification

Validated ef5388f.

  • Linux build, typecheck, architecture and Node HTTP/2 checks passed. bun test passed all 3,641 tests.
  • bun run check:pricing checked 101 IDs with zero missing and Auto as the sole exception.
  • bun run generate:pricing -- --check reproduced the committed file from live public pricing sources. The offline fixtures reproduced the same bytes.
  • Native catalog checks used recorded discovery data in OpenCode 1.19.6 and 2.3.2. OpenCode 2.3.2 exposed the context tiers in its model API. OpenCode 1.19.6 showed the flat catalog rate, and the provider supplies the calculated step cost through copilot.totalNanoAiu.

OpenCode 2 selects a context tier by its token size, so a 272k, 256k, or
100k surcharge is no longer stored as a 200k rate. Fast modes with a
published multiplier become their own catalog price, and Fast modes the
docs name without a number stay unpriced.

Co-authored-by: Oleksiy Akimov <[email protected]>
@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge; no new actionable issues remain.

Summary

The PR prices selectable models from markdown rows, then fills supported gaps from Cursor model pages and provider prices.

  • The pricing generator fills missing selectable model rates from saved model and provider pages.
  • Fast models and long prompts use their published prices.

No new actionable issues found. The three supplied, unnumbered previous findings are addressed. This review used source inspection; no tests or live requests were run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Read markdown prices] --> B[Find selectable price gaps]
  B --> C[Read required Cursor model pages]
  C --> D[Read provider prices for supported remaining gaps]
  D --> E{Required prices present?}
  E -->|No| F[Fail without writing]
  E -->|Yes| G[Generate pricing data]
  G --> H[Publish prices to both catalogs]
Loading

Reviews (6) · Last reviewed commit: "fix(pricing): verify selectable rates be..." · Reviewed by Greptile

Comment thread scripts/generate-cursor-pricing.ts Resolved
@codecov

codecov Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

cursoragent and others added 3 commits November 19, 2026 21:35
Offline markdown now checks the 2x Fast multipliers, explicit Fast-row
precedence, unpriced Fast notes, and the missing Opus 4.7 reference.

Co-authored-by: Oleksiy Akimov <[email protected]>
Offline markdown checks 2x input at an explicit threshold and the default
context, Haiku's published 5x rates, and a missing threshold. Invalid
cost tiers are rejected.

Co-authored-by: Oleksiy Akimov <[email protected]>
The generator treats each model's rendered HTML pricing table as the
rate and uses the main table only when that page has no matching row.
Auto uses the Cursor staff forum rate. GPT-5.4 Fast and its long-context
tier are derived from that page's own prose.

Co-authored-by: Oleksiy Akimov <[email protected]>
Comment thread scripts/generate-cursor-pricing.ts Fixed
Comment thread scripts/generate-cursor-pricing.ts Fixed
Comment thread scripts/generate-cursor-pricing.ts Fixed
@cursor cursor Bot changed the title Price selectable Fast modes at the published context thresholds Price every selectable model from its docs page Nov 19, 2026
CodeQL flagged chained entity replaces, comment stripping, and a script
regex that misses a spaced end tag. Entity decoding is one replace, and
comments and script blocks are removed by scanning for their markers.

Co-authored-by: Oleksiy Akimov <[email protected]>
Comment thread scripts/generate-cursor-pricing.ts Resolved
cursoragent and others added 3 commits November 19, 2026 23:18
--from-file with --context-from-file no longer downloads model pages.
--pages-from-dir reads saved <model-id>.html copies instead.

Co-authored-by: Oleksiy Akimov <[email protected]>
A run with both markdown files and --pages-from-dir reads those files
only. A model in the pricing markdown whose HTML file is absent fails
the run instead of being fetched.

Co-authored-by: Oleksiy Akimov <[email protected]>
A pricing-markdown row is the rate. A model page is read only when a
selectable variant has no row, and it does not replace that row. Notes
are not prices. Auto stays the hand-edited staff rate. Generation fails
before writing when a selectable model has no price.

Co-authored-by: Oleksiy Akimov <[email protected]>
@cursor cursor Bot changed the title Price every selectable model from its docs page Price selectable models from the markdown table Nov 19, 2026
The file run loads a model page only when a selectable variant has no
markdown row. Drop the 25 pages that run never reads.

Co-authored-by: Oleksiy Akimov <[email protected]>
Repository owner deleted a comment from cursor Bot Nov 20, 2026
Repository owner deleted a comment from cursor Bot Nov 20, 2026
Repository owner deleted a comment from cursor Bot Nov 20, 2026
Comment thread scripts/generate-cursor-pricing.ts Resolved
cursoragent and others added 4 commits November 20, 2026 00:17
A page fetched for a selectable Fast or long-context gap must contain a
pricing table and that row. Otherwise generation throws before writing
and does not keep the base rate for the missing variant.

Co-authored-by: Oleksiy Akimov <[email protected]>
Cursor bills third-party models at API list price. A Fast variant with no
Cursor price now comes from the Anthropic or OpenAI page. The standard row
is not copied onto Fast.

Co-authored-by: Oleksiy Akimov <[email protected]>
Comment thread scripts/generate-cursor-pricing.ts Fixed
Comment thread scripts/generate-cursor-pricing.ts Fixed
Comment thread test/pricing.test.ts Fixed
Comment thread test/pricing.test.ts Fixed
cursoragent and others added 2 commits November 20, 2026 10:30
CodeQL rejected a RegExp built from the Anthropic and OpenAI pricing URLs.

Co-authored-by: Oleksiy Akimov <[email protected]>
Validate standard and Fast context tiers independently. Use the published Gemini 3.1 Pro long-context rate and leave route-dependent Auto unpriced.

Validate Cursor pages before provider fallback and make saved-input generation reproduce the same bytes.

oakimov commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Follow-up in ef5388f updates pricing coverage and generation.

  • Auto (default) remains the sole intentional unpriced entry because billing can vary by route and plan.
  • Gemini 3.1 Pro keeps its base rate through 200k prompt tokens. Above 200k, it uses Google’s published Standard tier of $4 input, $0.40 cache read, and $18 output per million tokens. Google pricing
  • Generation checks standard and Fast long-context rates independently and validates required Cursor pages before provider fallback. Offline generation produces the same bytes regardless of input paths. Invalid pricing inputs leave the existing file intact.

All 3,641 Linux tests passed. Pricing coverage checked 101 IDs with zero missing, and the live pricing check reproduced the committed file. OpenCode 1.19.6 and 2.3.2 loaded the build with a recorded catalog.

@oakimov
oakimov merged commit 4c6b357 into main Nov 20, 2026
11 checks passed
@oakimov
oakimov deleted the cursor/selectable-variant-pricing-7d91 branch November 20, 2026 13:14
adonm added a commit to adonm/cursor-opencode-provider that referenced this pull request Nov 24, 2026
Adopt upstream's oakimov#199 pricing table, oakimov#200 in-place catalog refresh,
oakimov#201 CURSOR_PROGRESS_CONTINUATION opt-out, and oakimov#202 local AI SDK entry.
The fork's earlier ports (deb1787, 2bbab84, 9bf27b0 gate) are dropped
where upstream now covers the same ground.

Keep the fork-only pieces upstream still lacks: the seven-day conversation
snapshot default with fixed 24 h .tmp cleanup and resolver-derived test
ages, scripts/build-atomic.sh, scripts/sync-upstream.sh, the stale-dist
gate, and test/updater-build.test.ts.

Retire the last topic branch: nothing on perf/cache-ttl-and-lean-runtime
remains that upstream or this merge does not already cover, so TOPICS is
empty and the updater tests seed a synthetic topic into the copied script.
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