Skip to content

fix gpt-5.4 pricing - #24748

Merged
krrish-berri-2 merged 1 commit into
BerriAI:mainfrom
mubashir1osmani:fix-gpt-5.4
Apr 3, 2026
Merged

fix gpt-5.4 pricing#24748
krrish-berri-2 merged 1 commit into
BerriAI:mainfrom
mubashir1osmani:fix-gpt-5.4

Conversation

@mubashir1osmani

Copy link
Copy Markdown
Contributor

Relevant issues

gpt-5.4 & gpt-5.4-2026-03-05

  • Fixed output_cost_per_token_priority: 2.25e-05 → 3e-05 ($22.50 → $30.00/1M) — was incorrect per OpenAI docs
  • Removed input_cost_per_token_above_272k_tokens_priority,
    cache_read_input_token_cost_above_272k_tokens_priority, output_cost_per_token_above_272k_tokens_priority —
    OpenAI does not publish >272K pricing for the priority tier

gpt-5.4-mini

  • Fixed cache_read_input_token_cost_flex: 1e-08 → 3.75e-08 ($0.01 → $0.0375/1M)
  • Fixed cache_read_input_token_cost_batches: 3.8e-08 → 3.75e-08 (rounding error)
  • Added missing priority tier pricing: input 1.5e-06 ($1.50), cached 1.5e-07 ($0.15), output 9e-06 ($9.00/1M)

gpt-5.4-pro & gpt-5.4-pro-2026-03-05

  • Removed all priority tier fields — gpt-5.4-pro is not listed in OpenAI's priority pricing table

ref: https://developers.openai.com/api/docs/pricing?latest-pricing=priority

cc @Sameerlite please take over this PR

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test

Changes

@vercel

vercel Bot commented Mar 28, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Mar 28, 2026 10:32pm

Request Review

@codspeed-hq

codspeed-hq Bot commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing mubashir1osmani:fix-gpt-5.4 (23c7e99) with main (40d4e79)

Open in CodSpeed

@greptile-apps

greptile-apps Bot commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR corrects pricing data for several gpt-5.4 model variants in model_prices_and_context_window.json, aligning the values with the official OpenAI priority pricing table at developers.openai.com/api/docs/pricing.

Key changes verified against OpenAI's priority pricing table:

  • gpt-5.4 / gpt-5.4-2026-03-05: output_cost_per_token_priority corrected from 2.25e-05 ($22.50/1M) to 3e-05 ($30.00/1M) ✅; long-context priority fields (above-272k) removed since OpenAI publishes no long-context pricing for the priority tier (shown as - in the table) ✅
  • gpt-5.4-mini: cache_read_input_token_cost_flex corrected from 1e-08 to 3.75e-08 (50% of standard 7.5e-08, consistent with all other flex-tier ratios) ✅; cache_read_input_token_cost_batches rounding fix 3.8e-083.75e-08 ✅; missing priority tier fields added (input $1.50, cached $0.15, output $9.00 per 1M) ✅
  • gpt-5.4-pro / gpt-5.4-pro-2026-03-05: All priority tier fields removed — gpt-5.4-pro does not appear in OpenAI's published priority pricing table ✅

No tests were added, and the pre-submission checklist item "Adding at least 1 test is a hard requirement" is unchecked. For a data-only JSON pricing fix this is a minor process gap, but the correctness of the values is well-supported by the referenced official pricing page.

Confidence Score: 5/5

Safe to merge — all changed pricing values are verified correct against the official OpenAI priority pricing table.

All numeric corrections are cross-checked against the official OpenAI pricing docs: gpt-5.4 priority output $30/1M, gpt-5.4-mini priority tier fully added at correct rates, gpt-5.4-pro priority tier removal is justified. The only gap is a missing test, which is a process concern and does not affect correctness for a data-only JSON change.

No files require special attention — this is a single-file data fix with verified correct values.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Pricing corrections for gpt-5.4, gpt-5.4-2026-03-05, gpt-5.4-mini, gpt-5.4-pro, and gpt-5.4-pro-2026-03-05 — all changed values are verified correct against the official OpenAI pricing docs.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[API Request with service_tier] --> B{Tier?}
    B -- standard --> C[Standard pricing<br/>input / cached / output]
    B -- flex --> D[Flex pricing ~50%<br/>input_flex / cached_flex / output_flex]
    B -- batch --> E[Batch pricing ~50%<br/>input_batches / cached_batches / output_batches]
    B -- priority --> F{Model supports<br/>priority?}
    F -- Yes --> G[Priority pricing 2x<br/>input_priority / cached_priority / output_priority]
    F -- No --> H[No priority pricing<br/>fields defined]

    subgraph "After this PR"
        G1["gpt-5.4: output_priority $30.00 was $22.50"]
        G2["gpt-5.4-mini: full priority tier added"]
        H1["gpt-5.4-pro: priority tier removed - not in OpenAI table"]
    end

    G --> G1
    G --> G2
    H --> H1
Loading

Reviews (1): Last reviewed commit: "fix gpt-5.4 pricing" | Re-trigger Greptile

@Sameerlite Sameerlite left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@Classic298

Copy link
Copy Markdown
Contributor

@Sameerlite we need this

@mubashir1osmani

Copy link
Copy Markdown
Contributor Author

@ishaan-berri @ishaan-jaff

@krrish-berri-2
krrish-berri-2 merged commit d4a3a5e into BerriAI:main Apr 3, 2026
59 of 62 checks passed
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
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.

4 participants