[Fix] Add flex and priority pricing for o4-mini-2025-04-16 - #22086
[Fix] Add flex and priority pricing for o4-mini-2025-04-16#22086shivamrawat1 wants to merge 2 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThe PR adds flex and priority token pricing for the dated o4-mini-2025-04-16 model in both pricing maps. It also contains broad CI/workflow and installation-script changes beyond the stated pricing fix.
Confidence Score: 4/5The PR is not yet safe to merge because the previously reported dated-model pricing inconsistency remains unresolved. Only o4-mini-2025-04-16 receives tier-specific prices; the dated o3 and GPT-4.1-family entries still lack corresponding fields, causing priority or flex cost calculation to fall back to standard rates and under-report spend. Files Needing Attention: model_prices_and_context_window.json
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds the intended o4-mini dated-model prices, but the previously reported equivalent omissions on other dated entries remain. |
| litellm/model_prices_and_context_window_backup.json | Mirrors the six o4-mini-2025-04-16 tier-pricing additions from the canonical pricing map. |
| .circleci/config.yml | Broadly restructures dependency installation and test-job organization; no eligible new follow-up finding was identified. |
| scripts/install.sh | Adds installation tooling unrelated to the prior pricing thread; no eligible follow-up comment was retained. |
Reviews (3): Last reviewed commit: "chore: fixes" | Re-trigger Greptile
| "o4-mini-2025-04-16": { | ||
| "cache_read_input_token_cost": 2.75e-07, | ||
| "cache_read_input_token_cost_flex": 1.375e-07, | ||
| "cache_read_input_token_cost_priority": 5e-07, | ||
| "input_cost_per_token": 1.1e-06, | ||
| "input_cost_per_token_flex": 5.5e-07, | ||
| "input_cost_per_token_priority": 2e-06, | ||
| "litellm_provider": "openai", | ||
| "max_input_tokens": 200000, | ||
| "max_output_tokens": 100000, | ||
| "max_tokens": 100000, | ||
| "mode": "chat", | ||
| "output_cost_per_token": 4.4e-06, | ||
| "output_cost_per_token_flex": 2.2e-06, | ||
| "output_cost_per_token_priority": 8e-06, |
There was a problem hiding this comment.
Same issue exists in other dated model entries
This fix is correct for o4-mini-2025-04-16, but the same alias-vs-dated inconsistency exists for other models. The following dated entries are missing flex/priority pricing that their non-dated aliases define:
o3-2025-04-16(line 24034) — missing all 6 flex and priority keys thato3hasgpt-4.1-2025-04-14(line 18681) — missing priority keys thatgpt-4.1hasgpt-4.1-mini-2025-04-14— missing priority keys thatgpt-4.1-minihasgpt-4.1-nano-2025-04-14— missing priority keys thatgpt-4.1-nanohas
These will exhibit the same bug: completion_cost() returns standard-tier pricing when the API response uses the dated model name with service_tier="flex" or "priority". Consider fixing these in this PR for completeness.
|
shivam seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Relevant issues
When using o4-mini with service_tier="flex", completion_cost() was returning standard-tier cost instead of flex-tier cost because the cost calculator uses the model name from the API response (o4-mini-2025-04-16), not the one in the request (o4-mini). The o4-mini-2025-04-16 entry in the model cost map did not define flex/priority pricing keys (input_cost_per_token_flex, output_cost_per_token_flex, etc.), so the lookup fell back to standard pricing. The fix was to add these flex and priority pricing keys to o4-mini-2025-04-16 in both model_prices_and_context_window.json and model_prices_and_context_window_backup.json, using the same values as the o4-mini alias, so flex requests are priced correctly.
Pre-Submission checklist
Before:


After:
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🐛 Bug Fix
Changes