Skip to content

fix(core): correct gpt-3.5-turbo price and stop gpt-4.1 falling back to gpt-4 pricing - #13484

Open
Mattbusel wants to merge 2 commits into
continuedev:mainfrom
Mattbusel:fix/request-cost-price-table
Open

Mattbusel wants to merge 2 commits into
continuedev:mainfrom
Mattbusel:fix/request-cost-price-table

Conversation

@Mattbusel

Copy link
Copy Markdown

Description

calculateOpenAICost in core/llm/utils/calculateRequestCost.ts prices the bare gpt-3.5-turbo alias at $1.50/$2.00 per MTok (line 170). That is the instruct/0613 price; the alias points to gpt-3.5-turbo-0125 at $0.50/$1.50, so the console and CLI show 3x the real input cost. Because the table matches by prefix, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano and gpt-4-32k all fall through to base gpt-4 and are billed at $30/$60 (15x too high for gpt-4.1 at $2/$8), and gpt-4o-2024-05-13 gets the $2.50/$10 gpt-4o price instead of $5/$15. On the Anthropic side, Sonnet 4/4.5, Haiku 4.5 (the default in config_schema.json), Opus 4/4.1 and 3.7 Sonnet return no cost at all, so I added those rows (avoiding a bare claude-opus-4 prefix, which would catch the cheaper Opus 4.5+ ids) and fixed two mislabeled comments. Prices are from https://developers.openai.com/api/docs/pricing and https://platform.claude.com/docs/en/about-claude/pricing.

I also added .github/workflows/llm-price-drift.yml, a 27-line job that runs only on PRs touching this file plus weekly, and fails if a hard-coded price drifts from the official pages. It uses llm-prices, an MIT action I maintain; on this branch it reports 44 prices for 15 models with no drift, and on main it flags the two gpt-3.5-turbo values. Happy to drop that file if you would rather keep the PR to the table.

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screen recording or screenshot

N/A, pricing table change only.

Tests

Added 14 cases to core/llm/utils/calculateRequestCost.vitest.ts (Sonnet 4/4.5, Haiku 4.5 with cache reads, Opus 4/4.1, an Opus 4.6 guard, the bare gpt-3.5-turbo alias, instruct, 16k, gpt-4.1/mini/nano, gpt-4-32k, gpt-4o-2024-05-13). npx vitest run llm/utils/calculateRequestCost.vitest.ts: 36/36 pass; 12 of the new cases fail on main. Prettier check passes on the touched files.

I made this with help from Claude Code and reviewed it.

…to gpt-4 pricing

- gpt-3.5-turbo was priced at 1.5/2 per MTok (the instruct/0613 price);
  the bare alias points to 0125 at 0.5/1.5
- gpt-4.1, gpt-4.1-mini, gpt-4.1-nano and gpt-4-32k matched the base
  gpt-4 prefix and were billed at 30/60
- gpt-4o-2024-05-13 is 5/15, not the gpt-4o 2.5/10
- add Claude Sonnet 4/4.5, Haiku 4.5, Opus 4/4.1 and 3.7 Sonnet, which
  returned no cost at all
- add a small workflow that checks this table against the official
  pricing pages weekly and on PRs that touch it
@Mattbusel
Mattbusel requested a review from a team as a code owner November 15, 2026 19:13
@Mattbusel
Mattbusel requested review from sestinj and removed request for a team November 15, 2026 19:13
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Mattbusel

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

This branch has not been deployed

No deployments
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