Skip to content

fix(model_prices): add bedrock_mantle gpt-5.5/5.4 272K tiers, align sol with AWS invoice - #38615

Merged
mateo-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_mantle_gpt5_cost_tiers
Aug 28, 2026
Merged

fix(model_prices): add bedrock_mantle gpt-5.5/5.4 272K tiers, align sol with AWS invoice#38615
mateo-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_mantle_gpt5_cost_tiers

Conversation

@mateo-berri

@mateo-berri mateo-berri commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Bedrock gpt-5.5 and gpt-5.4 prompts over 272K tokens logged at the flat rate, half the invoice
  • gpt-5.6-sol logged at promo rates the AWS invoice does not bill, 20% under

How it solves it:

  • Adds the *_above_272k_tokens input, output, and cache-read rates to gpt-5.5 and gpt-5.4
  • Moves sol base and tier rates to the invoiced $5.50 / $33.00 / $0.55 / $6.88 per million
  • Replaces the test that pinned the flat behaviour with one that pins the invoiced numbers

User Flow

Before: a platform team reconciling gateway spend against its AWS bill finds Bedrock GPT-5.5 long prompts logged at half of what AWS charges, and Sol at 20% under

  1. Their app sends POST https://litellm-domain/v1/responses with "model": "mantle-55" (a bedrock_mantle/openai.gpt-5.5 deployment) and a 300K-token input
  2. It gets 200 with usage.input_tokens: 301016, and the response headers say x-litellm-response-cost-input: 1.655588, $5.50 per million for the whole prompt
  3. The same call to mantle-54 (bedrock_mantle/openai.gpt-5.4) comes back with x-litellm-response-cost-input: 0.827794, $2.75 per million
  4. A short prompt to mantle-sol (bedrock_mantle/openai.gpt-5.6-sol) with 16 input and 5 output tokens returns x-litellm-response-cost-input: 7.04e-05 and x-litellm-response-cost-output: 0.00011, $4.40 and $22.00 per million
  5. https://litellm-domain/ui/?page=logs shows the requests at that spend, while the AWS Cost Explorer lines for the same day bill the 300K prompt under input_tokens_long_ctx_standard at $11.00 per million (gpt-5.5) and $5.50 (gpt-5.4), and Sol at $5.50 input and $33.00 output, so the gateway under-reports the gpt-5.5 prompt by $1.66 and every Sol call by 20%

After: the same calls come back priced at what the AWS invoice charges

  1. Their app sends the same POST https://litellm-domain/v1/responses with "model": "mantle-55" and the 300K-token input
  2. It gets 200 with usage.input_tokens: 301015, and now x-litellm-response-cost-input: 3.311165, $11.00 per million for the whole prompt
  3. The same call to mantle-54 comes back with x-litellm-response-cost-input: 1.6555825, $5.50 per million
  4. The short prompt to mantle-sol returns x-litellm-response-cost-input: 8.8e-05 and x-litellm-response-cost-output: 0.000165, $5.50 and $33.00 per million
  5. https://litellm-domain/ui/?page=logs shows the requests at those amounts, matching the Cost Explorer lines

Relevant issues

Linear ticket

Resolves LIT-6356

Pre-Submission checklist

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

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Delays in PR merge?

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

Screenshots / Proof of Fix

Shared setup: each leg is its own DB-less proxy booted with 2 uvicorn workers (python litellm/proxy/proxy_cli.py --config lit6356_config.yaml --port <port> --num_workers 2) from a worktree at that leg's commit, with LITELLM_LOCAL_MODEL_COST_MAP=True and AWS_BEARER_TOKEN_BEDROCK for the Bedrock CI account, on this config. The streaming case that closes each side ran on a separate DB-backed proxy (real Postgres, same config, 2 workers): base on port 43917, head on port 41873

model_list:
  - model_name: mantle-55
    litellm_params:
      model: bedrock_mantle/openai.gpt-5.5
      aws_region_name: us-east-1
  - model_name: mantle-54
    litellm_params:
      model: bedrock_mantle/openai.gpt-5.4
      aws_region_name: us-east-1
  - model_name: mantle-sol
    litellm_params:
      model: bedrock_mantle/openai.gpt-5.6-sol
      aws_region_name: us-east-1
general_settings:
  master_key: sk-1234

The 300K bodies carry the same plain-text filler prompt on every endpoint (it asks for the single word "pong"), prefixed with a per-leg nonce so Bedrock's prompt cache stays cold: every call below reports cached 0. responses_*.json puts it in the Responses input string, chat_54.json in a chat messages list, and messages_54.json in an Anthropic messages list with max_tokens: 64. Each step runs curl -s -D hdr.txt -o out.json -w "http %{http_code}\n" <route> -H 'Authorization: Bearer sk-1234' -H 'Content-Type: application/json' --data-binary @<body> and then prints grep -i 'x-litellm-response-cost' hdr.txt and the usage object from out.json

What AWS bills the same account, from Cost Explorer for 2026-08-24 to 08-26: gpt-5.5 input_tokens_long_ctx_standard $11.00 per million and output_tokens_long_ctx_standard $49.50, gpt-5.4 $5.50 and $24.75, sol input_tokens_standard $5.50, output $33.00, cache read $0.55, cache write 30m $6.88

Before (98c5233)

gpt-5.5, 300K prompt, POST /v1/responses

  1. curl ... http://localhost:42685/v1/responses --data-binary @lit6356_qa_before_responses_55.json
  2. Output:
http 200
x-litellm-model-name: bedrock_mantle/openai.gpt-5.5
x-litellm-response-cost-input: 1.655588
x-litellm-response-cost-output: 0.000165
x-litellm-response-cost: 1.655753
usage: input 301016, cached 0, output 5, text 'pong'
  1. 301016 x $5.50 per million; AWS bills 301016 x $11.00 per million = $3.311176 input, twice what was logged

gpt-5.4, 300K prompt, POST /v1/responses

  1. curl ... http://localhost:42685/v1/responses --data-binary @lit6356_qa_before_responses_54.json
  2. Output:
http 200
x-litellm-model-name: bedrock_mantle/openai.gpt-5.4
x-litellm-response-cost-input: 0.827794
x-litellm-response-cost-output: 8.25e-05
x-litellm-response-cost: 0.8278765
usage: input 301016, cached 0, output 5, text 'pong'
  1. 301016 x $2.75 per million; AWS bills $5.50 per million = $1.655588 input

gpt-5.4, 300K prompt, POST /v1/chat/completions

  1. curl ... http://localhost:42685/v1/chat/completions --data-binary @lit6356_qa_before_chat_54.json
  2. Output:
http 200
x-litellm-model-name: bedrock_mantle/openai.gpt-5.4
x-litellm-response-cost-input: 0.827794
x-litellm-response-cost-output: 8.25e-05
x-litellm-response-cost: 0.8278765
usage: input 301016, cached 0, output 5, text 'pong'

gpt-5.4, 300K prompt, POST /v1/messages

  1. curl ... http://localhost:42685/v1/messages --data-binary @lit6356_qa_before_messages_54.json
  2. Output:
http 200
x-litellm-model-name: bedrock_mantle/openai.gpt-5.4
x-litellm-response-cost-input: 0.827794
x-litellm-response-cost-output: 8.25e-05
x-litellm-response-cost: 0.8278765
usage: input 301016, cached None, output 5, text 'pong'

gpt-5.6-sol, short prompt, POST /v1/responses

  1. curl ... http://localhost:42685/v1/responses -d '{"model":"mantle-sol","input":"Reply with exactly the word pong and nothing else."}'
  2. Output:
http 200
x-litellm-model-name: bedrock_mantle/openai.gpt-5.6-sol
x-litellm-response-cost-input: 7.04e-05
x-litellm-response-cost-output: 0.00010999999999999999
x-litellm-response-cost: 0.0001804
usage: input 16, cached 0, output 5, text 'pong'
  1. $4.40 input and $22.00 output per million; AWS bills $5.50 and $33.00, so $8.8e-05 and $1.65e-04

gpt-5.4, 300K prompt, POST /v1/chat/completions with stream: true, then GET /spend/logs

  1. curl -N ... http://localhost:43917/v1/chat/completions --data-binary @lit6356_risk_base_stream_chat_54.json (the chat_54 body plus "stream": true and "stream_options": {"include_usage": true})
  2. Output:
http 200
usage chunk: prompt_tokens 301025, completion_tokens 5, cached 0, text 'pong'
  1. curl -s "http://localhost:43917/spend/logs?request_id=<the row's resp_... id, from http://localhost:43917/ui/?page=logs>" -H 'Authorization: Bearer sk-1234'
  2. Output:
{'model': 'bedrock_mantle/openai.gpt-5.4', 'spend': 0.8279012499999999, 'prompt_tokens': 301025, 'completion_tokens': 5, 'total_tokens': 301030, 'call_type': 'responses'}
  1. 301025 x $2.75 per million plus 5 x $16.50 per million lands in the spend row, the flat rate

After (837bcba)

gpt-5.5, 300K prompt, POST /v1/responses

  1. curl ... http://localhost:42414/v1/responses --data-binary @lit6356_qa_after_responses_55.json
  2. Output:
http 200
x-litellm-model-name: bedrock_mantle/openai.gpt-5.5
x-litellm-response-cost-input: 3.311165
x-litellm-response-cost-output: 0.0002475
x-litellm-response-cost: 3.3114125
usage: input 301015, cached 0, output 5, text 'pong'
  1. 301015 x $11.00 per million input and 5 x $49.50 per million output, the invoiced long-context rates

gpt-5.4, 300K prompt, POST /v1/responses

  1. curl ... http://localhost:42414/v1/responses --data-binary @lit6356_qa_after_responses_54.json
  2. Output:
http 200
x-litellm-model-name: bedrock_mantle/openai.gpt-5.4
x-litellm-response-cost-input: 1.6555825
x-litellm-response-cost-output: 0.00012375
x-litellm-response-cost: 1.65570625
usage: input 301015, cached 0, output 5, text 'pong'
  1. 301015 x $5.50 per million input and 5 x $24.75 per million output

gpt-5.4, 300K prompt, POST /v1/chat/completions

  1. curl ... http://localhost:42414/v1/chat/completions --data-binary @lit6356_qa_after_chat_54.json
  2. Output:
http 200
x-litellm-model-name: bedrock_mantle/openai.gpt-5.4
x-litellm-response-cost-input: 1.6555825
x-litellm-response-cost-output: 0.00012375
x-litellm-response-cost: 1.65570625
usage: input 301015, cached 0, output 5, text 'pong'

gpt-5.4, 300K prompt, POST /v1/messages

  1. curl ... http://localhost:42414/v1/messages --data-binary @lit6356_qa_after_messages_54.json
  2. Output:
http 200
x-litellm-model-name: bedrock_mantle/openai.gpt-5.4
x-litellm-response-cost-input: 1.6555825
x-litellm-response-cost-output: 0.00012375
x-litellm-response-cost: 1.65570625
usage: input 301015, cached None, output 5, text 'pong'

gpt-5.6-sol, short prompt, POST /v1/responses

  1. curl ... http://localhost:42414/v1/responses -d '{"model":"mantle-sol","input":"Reply with exactly the word pong and nothing else."}'
  2. Output:
http 200
x-litellm-model-name: bedrock_mantle/openai.gpt-5.6-sol
x-litellm-response-cost-input: 8.8e-05
x-litellm-response-cost-output: 0.000165
x-litellm-response-cost: 0.00025299999999999997
usage: input 16, cached 0, output 5, text 'pong'
  1. $5.50 input and $33.00 output per million, matching the invoice

gpt-5.4, 300K prompt, POST /v1/chat/completions with stream: true, then GET /spend/logs

  1. curl -N ... http://localhost:41873/v1/chat/completions --data-binary @lit6356_risk_head_stream_chat_54.json (the chat_54 body plus "stream": true and "stream_options": {"include_usage": true})
  2. Output:
http 200
usage chunk: prompt_tokens 301025, completion_tokens 5, cached 0, text 'pong'
  1. curl -s "http://localhost:41873/spend/logs?request_id=<the row's resp_... id, from http://localhost:41873/ui/?page=logs>" -H 'Authorization: Bearer sk-1234'
  2. Output:
{'model': 'bedrock_mantle/openai.gpt-5.4', 'spend': 1.65576125, 'prompt_tokens': 301025, 'completion_tokens': 5, 'total_tokens': 301030, 'call_type': 'responses'}
  1. 301025 x $5.50 per million plus 5 x $24.75 per million lands in the spend row, the invoiced long-context rates

Observations from the run:

  • Whole completion bills the 1.5x output tier past 272K, as AWS does
  • /v1/messages usage omits cache_read_input_tokens; this PR leaves it alone
  • Cache-read tiers not exercised live: every call reported cached 0
  • Streaming spend row carries the tier on head
  • Spend row request_id is the resp_ id on both legs

Type

🐛 Bug Fix

Caveats (if any)

Medium

  • AWS announced Sol promo pricing ($4.40 / $22.00) on 2026-08-21, through at least 2026-11-21
    • Cost Explorer for 08-24, 08-25, and 08-26 still bills $5.50 / $33.00 / $0.55 / $6.88, with no credit lines
    • This PR follows the invoice; fix(pricing): add promo pricing for GPT-5.6 Sol on Bedrock #38127 follows the announcement and goes the other way on sol
    • If the meter drops to the promo rate, sol needs a follow-up back to the 4.4e-06 rates
  • us.openai.gpt-5.6-sol and global.openai.gpt-5.6-sol keep the promo rates, no invoice data for them

Low

  • The 2x cache-read tier for gpt-5.5 and gpt-5.4 mirrors OpenAI's own gpt-5.5 tier shape
    • Cost Explorer shows no cache-read line for either model yet, even after cached replays
    • Luna's invoiced long-context cache-read line is 2x its standard one, same family shape
  • The 272K threshold mirrors sol and OpenAI direct; only 300K-plus prompts were sent
  • AWS's gpt-5.5 model card still lists flat pricing and a 272K window; the invoice disagrees
  • make check gates none of these files; ruff on the two test files reports only pre-existing findings

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

  • 837bcba passes /live-pr-risk

…ol with AWS invoice

AWS bills a Bedrock GPT-5.5 or GPT-5.4 prompt past 272K tokens under the long-context usage types for the
whole prompt, at 2x input, 2x cache read, and 1.5x output, and the cost map only had the flat rates, so a
300K prompt was logged at half of what the invoice charges. The map's promo rates for gpt-5.6-sol are 20%
under the $5.50 input, $33.00 output, $0.55 cache read, and $6.88 cache write per million the invoice bills.

Adds the *_above_272k_tokens fields to gpt-5.5 and gpt-5.4, moves sol's base and tier rates to the invoiced
ones, replaces the test that pinned the flat behaviour with one that pins the invoiced numbers, and updates
the sol pins in the mantle transformation tests
@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR aligns Bedrock Mantle GPT-5 pricing with observed AWS invoice rates.

  • Adds above-272K input, cache-read, and output tiers for GPT-5.5 and GPT-5.4.
  • Updates GPT-5.6 Sol base, long-context, cache-read, cache-write, and output rates.
  • Keeps the root and bundled pricing maps synchronized and expands cost-calculation regression coverage.

Confidence Score: 5/5

The PR appears safe to merge with the pricing maps synchronized and the revised base and long-context behavior covered by tests.

The metadata keys match the generic threshold-pricing contract, both runtime map copies agree, and no concrete changed-code failure remains.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Updates the canonical Bedrock Mantle GPT-5.4, GPT-5.5, and GPT-5.6 Sol pricing entries consistently with the intended invoice rates.
litellm/model_prices_and_context_window_backup.json Mirrors the canonical pricing changes in the bundled runtime fallback map without divergence.
tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py Replaces the obsolete flat-rate expectation with base-boundary and long-context cost assertions and adds Sol cache-write rate coverage.
tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py Updates Bedrock Mantle model-info and end-to-end response cost expectations for the revised Sol rates.

Reviews (1): Last reviewed commit: "fix(model_prices): add bedrock_mantle gp..." | Re-trigger Greptile

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mateo-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 837bcba. Configure here.

@codspeed-hq

codspeed-hq Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_mantle_gpt5_cost_tiers (837bcba) with litellm_internal_staging (98c5233)

Open in CodSpeed

@mateo-berri
mateo-berri merged commit 3a52ae0 into litellm_internal_staging Aug 28, 2026
118 of 128 checks passed
@mateo-berri
mateo-berri deleted the litellm_mantle_gpt5_cost_tiers branch August 28, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants