Skip to content

fix(pricing): apply the GPT-5.6 Luna and Terra price cuts across OpenAI and Bedrock Mantle - #35316

Closed
devin-ai-integration[bot] wants to merge 2 commits into
litellm_internal_stagingfrom
litellm_gpt56_bedrock_mantle_reprice
Closed

fix(pricing): apply the GPT-5.6 Luna and Terra price cuts across OpenAI and Bedrock Mantle#35316
devin-ai-integration[bot] wants to merge 2 commits into
litellm_internal_stagingfrom
litellm_gpt56_bedrock_mantle_reprice

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • We bill GPT-5.6 Luna at 5x the real rate
  • We bill GPT-5.6 Terra 25% over the real rate
  • Bedrock Mantle Luna and Terra are stale too

How it solves it:

  • Scale every Luna cost key by 0.2
  • Scale every Terra cost key by 0.8
  • Same cut on the Bedrock Mantle entries, uplift kept
  • Pin the new rates in tests

Relevant issues

Linear ticket

Resolves LIT-5011

Pre-Submission checklist

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

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • 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

Real calls against a local proxy, hitting the OpenAI API and AWS Bedrock Mantle for real. Config used:

model_list:
  - model_name: gpt-5.6-luna
    litellm_params:
      model: openai/gpt-5.6-luna
      api_key: os.environ/OPENAI_API_KEY
  - model_name: gpt-5.6-terra
    litellm_params:
      model: openai/gpt-5.6-terra
      api_key: os.environ/OPENAI_API_KEY
  - model_name: mantle-luna
    litellm_params:
      model: bedrock_mantle/openai.gpt-5.6-luna
      aws_access_key_id: os.environ/AWS_ACCESS_KEY_ID
      aws_secret_access_key: os.environ/AWS_SECRET_ACCESS_KEY
      aws_region_name: us-east-1

general_settings:
  master_key: sk-1234

Steps, run once on the base commit and once on this branch:

  1. LITELLM_LOCAL_MODEL_COST_MAP=True uv run --no-sync python litellm/proxy/proxy_cli.py --config proof_config.yaml
  2. for each of gpt-5.6-luna and gpt-5.6-terra, read the billed cost off the response headers
for model in gpt-5.6-luna gpt-5.6-terra; do
  curl -s -D - -o /tmp/body.json http://localhost:4000/v1/chat/completions \
    -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" \
    -d "{\"model\":\"$model\",\"messages\":[{\"role\":\"user\",\"content\":\"reply with the single word: ok\"}],\"max_completion_tokens\":16}" \
    | grep -i "^x-litellm-response-cost:"
done
  1. same for Bedrock Mantle over /v1/responses
curl -s -D - -o /tmp/mantle.json http://localhost:4000/v1/responses \
  -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" \
  -d '{"model":"mantle-luna","input":"reply with the single word: ok"}' \
  | grep -i "^x-litellm-response-cost:"

Before, at 81ff7cb38f (base):

== gpt-5.6-luna    13 prompt / 4 completion tokens
x-litellm-response-cost: 3.7e-05
== gpt-5.6-terra   13 prompt / 4 completion tokens
x-litellm-response-cost: 9.25e-05
== mantle-luna     13 input / 5 output tokens
x-litellm-response-cost: 4.7300000000000005e-05

After, at 854bb239f3 (this branch):

== gpt-5.6-luna    13 prompt / 4 completion tokens
x-litellm-response-cost: 7.3999999999999995e-06
== gpt-5.6-terra   13 prompt / 4 completion tokens
x-litellm-response-cost: 7.4e-05
== mantle-luna     13 input tokens, 11 of them cache writes / 5 output
x-litellm-response-cost: 1.0065000000000001e-05

Luna drops 5x and Terra drops 20%, matching the announcement. The three Mantle numbers reconcile by hand as 2 * 2.2e-07 + 11 * 2.75e-07 + 5 * 1.32e-06 = 1.0065e-05 against the new rates, versus 13 * 1.1e-06 + 5 * 6.6e-06 = 4.73e-05 on the old ones

Type

🐛 Bug Fix

Changes

OpenAI cut Luna by 80% and Terra by 20% on 2026-07-30; Luna is now $0.20/M input and $1.20/M output, Terra is $2/M and $12/M. Sol is unchanged. Our cost map still carried the launch rates, so every Luna request was billed at 5x and every Terra request at 1.25x, which lands in SpendLogs and in customer budgets

Rather than hand-editing the eighteen cost keys per model, each *cost* key inside the gpt-5.6-terra and gpt-5.6-luna entries is multiplied by the announced cut (0.8 and 0.2). That keeps every derived tier internally consistent with the base rate without re-deriving them by hand:

input_cost_per_token             2.5e-06 * 0.8 -> 2e-06
input_cost_per_token_flex        1.25e-06 * 0.8 -> 1e-06
input_cost_per_token_priority    5e-06 * 0.8 -> 4e-06
cache_read_input_token_cost      2.5e-07 * 0.8 -> 2e-07
... and the same for _batches, _above_272k_tokens, and cache_creation_*

The announcement says the cuts roll out on AWS the same day, so bedrock_mantle/openai.gpt-5.6-terra and bedrock_mantle/openai.gpt-5.6-luna get the same treatment; they stay at exactly 1.1x the OpenAI rate, which a new test now asserts instead of leaving it as folklore

Azure is deliberately left alone. Microsoft has not announced a matching cut, so test_gpt_5_6_model_metadata.py splits the shared STANDARD_PRICING fixture into OPENAI_STANDARD_PRICING and AZURE_STANDARD_PRICING; Azure keeps the old numbers and will diverge until Microsoft moves

Overlaps with #35258, which makes the same OpenAI-side change; that one does not cover Bedrock Mantle, so whichever lands first, the other needs a rebase

Fast mode, which replaces Priority Processing in the same announcement, is handled separately in #35320

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

Link to Devin session: https://app.devin.ai/sessions/bdd531a0c9ce49679c29fa6a3d40fb27

…AI and Bedrock Mantle

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Updates GPT-5.6 Luna and Terra pricing while preserving provider-specific behavior.

  • Reduces OpenAI Luna and Terra standard, cache, batch, flex, priority, and long-context rates in both pricing maps.
  • Applies corresponding reductions with the existing uplift to Bedrock Mantle.
  • Keeps Azure pricing unchanged and separates OpenAI and Azure test expectations.
  • Adds assertions for updated pricing, Mantle uplift behavior, and synchronization between the canonical and bundled maps.

Confidence Score: 5/5

The PR appears safe to merge with pricing maps and focused tests consistently reflecting the intended provider-specific rates.

The canonical and bundled maps remain synchronized, OpenAI and Mantle rates are updated consistently, Azure remains deliberately unchanged, and no concrete changed-code failure remains.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Updates canonical OpenAI and Bedrock Mantle Luna/Terra rates consistently across the applicable pricing dimensions.
litellm/model_prices_and_context_window_backup.json Keeps the bundled fallback pricing map synchronized with the canonical map.
tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py Updates generic cost-calculation expectations for the new OpenAI standard and cache rates.
tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py Updates Bedrock Mantle pricing expectations for Luna and Terra.
tests/test_litellm/test_gpt_5_6_model_metadata.py Separates OpenAI and Azure pricing contracts and adds Mantle metadata, uplift, and backup synchronization coverage.

Reviews (1): Last reviewed commit: "fix(pricing): apply the GPT-5.6 Luna and..." | Re-trigger Greptile

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Superseded by #35270, which landed the same Luna/Terra cuts on the openai entries and the same 1.1x Bedrock Mantle numbers, plus the flex long-context keys. Verified staging now bills Luna at 7.4e-06 and Mantle Luna at 1.0065e-05 for the same requests I proved out here, so there is nothing left in this branch. Fast mode is still open in #35320

@codspeed-hq

codspeed-hq Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_gpt56_bedrock_mantle_reprice (abe2222) with litellm_internal_staging (81ff7cb)

Open in CodSpeed

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