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

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
milan 2026-07-31 03:55:21 +00:00
parent 81ff7cb38f
commit 854bb239f3
5 changed files with 153 additions and 97 deletions

View file

@ -23782,29 +23782,29 @@
"supports_xhigh_reasoning_effort": true
},
"gpt-5.6-terra": {
"cache_creation_input_token_cost": 3.125e-06,
"cache_creation_input_token_cost_above_272k_tokens": 6.25e-06,
"cache_creation_input_token_cost_flex": 1.5625e-06,
"cache_creation_input_token_cost_priority": 6.25e-06,
"cache_read_input_token_cost": 2.5e-07,
"cache_read_input_token_cost_above_272k_tokens": 5e-07,
"cache_read_input_token_cost_flex": 1.25e-07,
"cache_read_input_token_cost_priority": 5e-07,
"input_cost_per_token": 2.5e-06,
"input_cost_per_token_above_272k_tokens": 5e-06,
"input_cost_per_token_batches": 1.25e-06,
"input_cost_per_token_flex": 1.25e-06,
"input_cost_per_token_priority": 5e-06,
"cache_creation_input_token_cost": 2.5e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5e-06,
"cache_creation_input_token_cost_flex": 1.25e-06,
"cache_creation_input_token_cost_priority": 5e-06,
"cache_read_input_token_cost": 2e-07,
"cache_read_input_token_cost_above_272k_tokens": 4e-07,
"cache_read_input_token_cost_flex": 1e-07,
"cache_read_input_token_cost_priority": 4e-07,
"input_cost_per_token": 2e-06,
"input_cost_per_token_above_272k_tokens": 4e-06,
"input_cost_per_token_batches": 1e-06,
"input_cost_per_token_flex": 1e-06,
"input_cost_per_token_priority": 4e-06,
"litellm_provider": "openai",
"max_input_tokens": 1050000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
"output_cost_per_token": 1.5e-05,
"output_cost_per_token_above_272k_tokens": 2.25e-05,
"output_cost_per_token_batches": 7.5e-06,
"output_cost_per_token_flex": 7.5e-06,
"output_cost_per_token_priority": 3e-05,
"output_cost_per_token": 1.2e-05,
"output_cost_per_token_above_272k_tokens": 1.8e-05,
"output_cost_per_token_batches": 6e-06,
"output_cost_per_token_flex": 6e-06,
"output_cost_per_token_priority": 2.4e-05,
"regional_processing_uplift_multiplier_eu": 1.1,
"regional_processing_uplift_multiplier_us": 1.1,
"supported_endpoints": [
@ -23835,29 +23835,29 @@
"supports_xhigh_reasoning_effort": true
},
"gpt-5.6-luna": {
"cache_creation_input_token_cost": 1.25e-06,
"cache_creation_input_token_cost_above_272k_tokens": 2.5e-06,
"cache_creation_input_token_cost_flex": 6.25e-07,
"cache_creation_input_token_cost_priority": 2.5e-06,
"cache_read_input_token_cost": 1e-07,
"cache_read_input_token_cost_above_272k_tokens": 2e-07,
"cache_read_input_token_cost_flex": 5e-08,
"cache_read_input_token_cost_priority": 2e-07,
"input_cost_per_token": 1e-06,
"input_cost_per_token_above_272k_tokens": 2e-06,
"input_cost_per_token_batches": 5e-07,
"input_cost_per_token_flex": 5e-07,
"input_cost_per_token_priority": 2e-06,
"cache_creation_input_token_cost": 2.5e-07,
"cache_creation_input_token_cost_above_272k_tokens": 5e-07,
"cache_creation_input_token_cost_flex": 1.25e-07,
"cache_creation_input_token_cost_priority": 5e-07,
"cache_read_input_token_cost": 2e-08,
"cache_read_input_token_cost_above_272k_tokens": 4e-08,
"cache_read_input_token_cost_flex": 1e-08,
"cache_read_input_token_cost_priority": 4e-08,
"input_cost_per_token": 2e-07,
"input_cost_per_token_above_272k_tokens": 4e-07,
"input_cost_per_token_batches": 1e-07,
"input_cost_per_token_flex": 1e-07,
"input_cost_per_token_priority": 4e-07,
"litellm_provider": "openai",
"max_input_tokens": 1050000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
"output_cost_per_token": 6e-06,
"output_cost_per_token_above_272k_tokens": 9e-06,
"output_cost_per_token_batches": 3e-06,
"output_cost_per_token_flex": 3e-06,
"output_cost_per_token_priority": 1.2e-05,
"output_cost_per_token": 1.2e-06,
"output_cost_per_token_above_272k_tokens": 1.8e-06,
"output_cost_per_token_batches": 6e-07,
"output_cost_per_token_flex": 6e-07,
"output_cost_per_token_priority": 2.4e-06,
"regional_processing_uplift_multiplier_eu": 1.1,
"regional_processing_uplift_multiplier_us": 1.1,
"supported_endpoints": [
@ -45120,10 +45120,10 @@
"supports_vision": true
},
"bedrock_mantle/openai.gpt-5.6-terra": {
"input_cost_per_token": 2.75e-06,
"cache_creation_input_token_cost": 3.4375e-06,
"cache_read_input_token_cost": 2.75e-07,
"output_cost_per_token": 1.65e-05,
"input_cost_per_token": 2.2e-06,
"cache_creation_input_token_cost": 2.75e-06,
"cache_read_input_token_cost": 2.2e-07,
"output_cost_per_token": 1.32e-05,
"litellm_provider": "bedrock_mantle",
"max_input_tokens": 272000,
"max_output_tokens": 128000,
@ -45148,10 +45148,10 @@
"supports_vision": true
},
"bedrock_mantle/openai.gpt-5.6-luna": {
"input_cost_per_token": 1.1e-06,
"cache_creation_input_token_cost": 1.375e-06,
"cache_read_input_token_cost": 1.1e-07,
"output_cost_per_token": 6.6e-06,
"input_cost_per_token": 2.2e-07,
"cache_creation_input_token_cost": 2.75e-07,
"cache_read_input_token_cost": 2.2e-08,
"output_cost_per_token": 1.32e-06,
"litellm_provider": "bedrock_mantle",
"max_input_tokens": 272000,
"max_output_tokens": 128000,

View file

@ -23857,29 +23857,29 @@
"supports_xhigh_reasoning_effort": true
},
"gpt-5.6-terra": {
"cache_creation_input_token_cost": 3.125e-06,
"cache_creation_input_token_cost_above_272k_tokens": 6.25e-06,
"cache_creation_input_token_cost_flex": 1.5625e-06,
"cache_creation_input_token_cost_priority": 6.25e-06,
"cache_read_input_token_cost": 2.5e-07,
"cache_read_input_token_cost_above_272k_tokens": 5e-07,
"cache_read_input_token_cost_flex": 1.25e-07,
"cache_read_input_token_cost_priority": 5e-07,
"input_cost_per_token": 2.5e-06,
"input_cost_per_token_above_272k_tokens": 5e-06,
"input_cost_per_token_batches": 1.25e-06,
"input_cost_per_token_flex": 1.25e-06,
"input_cost_per_token_priority": 5e-06,
"cache_creation_input_token_cost": 2.5e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5e-06,
"cache_creation_input_token_cost_flex": 1.25e-06,
"cache_creation_input_token_cost_priority": 5e-06,
"cache_read_input_token_cost": 2e-07,
"cache_read_input_token_cost_above_272k_tokens": 4e-07,
"cache_read_input_token_cost_flex": 1e-07,
"cache_read_input_token_cost_priority": 4e-07,
"input_cost_per_token": 2e-06,
"input_cost_per_token_above_272k_tokens": 4e-06,
"input_cost_per_token_batches": 1e-06,
"input_cost_per_token_flex": 1e-06,
"input_cost_per_token_priority": 4e-06,
"litellm_provider": "openai",
"max_input_tokens": 1050000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
"output_cost_per_token": 1.5e-05,
"output_cost_per_token_above_272k_tokens": 2.25e-05,
"output_cost_per_token_batches": 7.5e-06,
"output_cost_per_token_flex": 7.5e-06,
"output_cost_per_token_priority": 3e-05,
"output_cost_per_token": 1.2e-05,
"output_cost_per_token_above_272k_tokens": 1.8e-05,
"output_cost_per_token_batches": 6e-06,
"output_cost_per_token_flex": 6e-06,
"output_cost_per_token_priority": 2.4e-05,
"regional_processing_uplift_multiplier_eu": 1.1,
"regional_processing_uplift_multiplier_us": 1.1,
"supported_endpoints": [
@ -23910,29 +23910,29 @@
"supports_xhigh_reasoning_effort": true
},
"gpt-5.6-luna": {
"cache_creation_input_token_cost": 1.25e-06,
"cache_creation_input_token_cost_above_272k_tokens": 2.5e-06,
"cache_creation_input_token_cost_flex": 6.25e-07,
"cache_creation_input_token_cost_priority": 2.5e-06,
"cache_read_input_token_cost": 1e-07,
"cache_read_input_token_cost_above_272k_tokens": 2e-07,
"cache_read_input_token_cost_flex": 5e-08,
"cache_read_input_token_cost_priority": 2e-07,
"input_cost_per_token": 1e-06,
"input_cost_per_token_above_272k_tokens": 2e-06,
"input_cost_per_token_batches": 5e-07,
"input_cost_per_token_flex": 5e-07,
"input_cost_per_token_priority": 2e-06,
"cache_creation_input_token_cost": 2.5e-07,
"cache_creation_input_token_cost_above_272k_tokens": 5e-07,
"cache_creation_input_token_cost_flex": 1.25e-07,
"cache_creation_input_token_cost_priority": 5e-07,
"cache_read_input_token_cost": 2e-08,
"cache_read_input_token_cost_above_272k_tokens": 4e-08,
"cache_read_input_token_cost_flex": 1e-08,
"cache_read_input_token_cost_priority": 4e-08,
"input_cost_per_token": 2e-07,
"input_cost_per_token_above_272k_tokens": 4e-07,
"input_cost_per_token_batches": 1e-07,
"input_cost_per_token_flex": 1e-07,
"input_cost_per_token_priority": 4e-07,
"litellm_provider": "openai",
"max_input_tokens": 1050000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
"output_cost_per_token": 6e-06,
"output_cost_per_token_above_272k_tokens": 9e-06,
"output_cost_per_token_batches": 3e-06,
"output_cost_per_token_flex": 3e-06,
"output_cost_per_token_priority": 1.2e-05,
"output_cost_per_token": 1.2e-06,
"output_cost_per_token_above_272k_tokens": 1.8e-06,
"output_cost_per_token_batches": 6e-07,
"output_cost_per_token_flex": 6e-07,
"output_cost_per_token_priority": 2.4e-06,
"regional_processing_uplift_multiplier_eu": 1.1,
"regional_processing_uplift_multiplier_us": 1.1,
"supported_endpoints": [
@ -45241,10 +45241,10 @@
"supports_vision": true
},
"bedrock_mantle/openai.gpt-5.6-terra": {
"input_cost_per_token": 2.75e-06,
"cache_creation_input_token_cost": 3.4375e-06,
"cache_read_input_token_cost": 2.75e-07,
"output_cost_per_token": 1.65e-05,
"input_cost_per_token": 2.2e-06,
"cache_creation_input_token_cost": 2.75e-06,
"cache_read_input_token_cost": 2.2e-07,
"output_cost_per_token": 1.32e-05,
"litellm_provider": "bedrock_mantle",
"max_input_tokens": 272000,
"max_output_tokens": 128000,
@ -45269,10 +45269,10 @@
"supports_vision": true
},
"bedrock_mantle/openai.gpt-5.6-luna": {
"input_cost_per_token": 1.1e-06,
"cache_creation_input_token_cost": 1.375e-06,
"cache_read_input_token_cost": 1.1e-07,
"output_cost_per_token": 6.6e-06,
"input_cost_per_token": 2.2e-07,
"cache_creation_input_token_cost": 2.75e-07,
"cache_read_input_token_cost": 2.2e-08,
"output_cost_per_token": 1.32e-06,
"litellm_provider": "bedrock_mantle",
"max_input_tokens": 272000,
"max_output_tokens": 128000,

View file

@ -611,8 +611,8 @@ def test_generic_cost_per_token_gpt55_pro():
[
("gpt-5.6", 5e-6, 3e-5, 5e-7, 6.25e-6),
("gpt-5.6-sol", 5e-6, 3e-5, 5e-7, 6.25e-6),
("gpt-5.6-terra", 2.5e-6, 1.5e-5, 2.5e-7, 3.125e-6),
("gpt-5.6-luna", 1e-6, 6e-6, 1e-7, 1.25e-6),
("gpt-5.6-terra", 2e-6, 1.2e-5, 2e-7, 2.5e-6),
("gpt-5.6-luna", 2e-7, 1.2e-6, 2e-8, 2.5e-7),
],
)
def test_generic_cost_per_token_gpt56(

View file

@ -1519,8 +1519,8 @@ class TestBedrockMantleResponsesPricing:
"model, input_cost, cache_creation_cost, cache_read_cost, output_cost",
[
("openai.gpt-5.6-sol", 5.5e-06, 6.875e-06, 5.5e-07, 3.3e-05),
("openai.gpt-5.6-terra", 2.75e-06, 3.4375e-06, 2.75e-07, 1.65e-05),
("openai.gpt-5.6-luna", 1.1e-06, 1.375e-06, 1.1e-07, 6.6e-06),
("openai.gpt-5.6-terra", 2.2e-06, 2.75e-06, 2.2e-07, 1.32e-05),
("openai.gpt-5.6-luna", 2.2e-07, 2.75e-07, 2.2e-08, 1.32e-06),
],
)
def test_gpt_5_6_pricing_and_mode(

View file

@ -7,7 +7,14 @@ from litellm.litellm_core_utils.get_llm_provider_logic import get_llm_provider
GPT_5_6_MODELS = ("gpt-5.6", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna")
STANDARD_PRICING = {
OPENAI_STANDARD_PRICING = {
"gpt-5.6": (5e-06, 3e-05, 5e-07, 6.25e-06),
"gpt-5.6-sol": (5e-06, 3e-05, 5e-07, 6.25e-06),
"gpt-5.6-terra": (2e-06, 1.2e-05, 2e-07, 2.5e-06),
"gpt-5.6-luna": (2e-07, 1.2e-06, 2e-08, 2.5e-07),
}
AZURE_STANDARD_PRICING = {
"gpt-5.6": (5e-06, 3e-05, 5e-07, 6.25e-06),
"gpt-5.6-sol": (5e-06, 3e-05, 5e-07, 6.25e-06),
"gpt-5.6-terra": (2.5e-06, 1.5e-05, 2.5e-07, 3.125e-06),
@ -27,7 +34,7 @@ def test_openai_gpt_5_6_model_info(model):
assert info["litellm_provider"] == "openai"
assert info["mode"] == "chat"
input_cost, output_cost, cache_read_cost, cache_write_cost = STANDARD_PRICING[model]
input_cost, output_cost, cache_read_cost, cache_write_cost = OPENAI_STANDARD_PRICING[model]
assert info["input_cost_per_token"] == input_cost
assert info["output_cost_per_token"] == output_cost
assert info["cache_read_input_token_cost"] == cache_read_cost
@ -95,7 +102,7 @@ def test_azure_gpt_5_6_global_model_info(model):
assert info["litellm_provider"] == "azure"
assert info["mode"] == "chat"
input_cost, output_cost, cache_read_cost, _ = STANDARD_PRICING[_tier_key(model)]
input_cost, output_cost, cache_read_cost, _ = AZURE_STANDARD_PRICING[_tier_key(model)]
assert info["input_cost_per_token"] == input_cost
assert info["output_cost_per_token"] == output_cost
assert info["cache_read_input_token_cost"] == cache_read_cost
@ -124,7 +131,7 @@ def test_azure_gpt_5_6_regional_model_info(model):
assert info["litellm_provider"] == "azure"
assert info["mode"] == "chat"
input_cost, output_cost, cache_read_cost, _ = STANDARD_PRICING[_tier_key(model)]
input_cost, output_cost, cache_read_cost, _ = AZURE_STANDARD_PRICING[_tier_key(model)]
assert info["input_cost_per_token"] == pytest.approx(input_cost * 1.1)
assert info["output_cost_per_token"] == pytest.approx(output_cost * 1.1)
@ -142,6 +149,55 @@ def test_azure_gpt_5_6_regional_model_info(model):
assert provider == "azure"
BEDROCK_MANTLE_MODELS = (
"bedrock_mantle/openai.gpt-5.6-sol",
"bedrock_mantle/openai.gpt-5.6-terra",
"bedrock_mantle/openai.gpt-5.6-luna",
)
BEDROCK_MANTLE_PRICING = {
"bedrock_mantle/openai.gpt-5.6-sol": (5.5e-06, 3.3e-05, 5.5e-07, 6.875e-06),
"bedrock_mantle/openai.gpt-5.6-terra": (2.2e-06, 1.32e-05, 2.2e-07, 2.75e-06),
"bedrock_mantle/openai.gpt-5.6-luna": (2.2e-07, 1.32e-06, 2.2e-08, 2.75e-07),
}
@pytest.mark.parametrize("model", BEDROCK_MANTLE_MODELS)
def test_bedrock_mantle_gpt_5_6_model_info(model):
model_cost = _load_main()
info = model_cost.get(model)
assert info is not None, f"{model} not found in model_prices_and_context_window.json"
assert info["litellm_provider"] == "bedrock_mantle"
assert info["mode"] == "responses"
input_cost, output_cost, cache_read_cost, cache_write_cost = BEDROCK_MANTLE_PRICING[model]
assert info["input_cost_per_token"] == input_cost
assert info["output_cost_per_token"] == output_cost
assert info["cache_read_input_token_cost"] == cache_read_cost
assert info["cache_creation_input_token_cost"] == cache_write_cost
assert info["cache_read_input_token_cost"] == pytest.approx(input_cost * 0.1)
assert info["cache_creation_input_token_cost"] == pytest.approx(input_cost * 1.25)
_, provider, _, _ = get_llm_provider(model=model)
assert provider == "bedrock_mantle"
def test_bedrock_mantle_gpt_5_6_carries_the_regional_uplift_over_openai():
model_cost = _load_main()
for mantle_model, openai_model in (
("bedrock_mantle/openai.gpt-5.6-terra", "gpt-5.6-terra"),
("bedrock_mantle/openai.gpt-5.6-luna", "gpt-5.6-luna"),
):
mantle_input, mantle_output, _, _ = BEDROCK_MANTLE_PRICING[mantle_model]
openai_info = model_cost[openai_model]
uplift = openai_info["regional_processing_uplift_multiplier_us"]
assert mantle_input == pytest.approx(openai_info["input_cost_per_token"] * uplift)
assert mantle_output == pytest.approx(openai_info["output_cost_per_token"] * uplift)
def test_gpt_5_6_backup_matches_main():
"""Ensure the bundled model cost map stays in sync with the canonical file."""
repo_root = Path(__file__).parents[2]
@ -153,7 +209,7 @@ def test_gpt_5_6_backup_matches_main():
with open(backup_path) as f:
backup_cost = json.load(f)
for model in GPT_5_6_MODELS + AZURE_GLOBAL_MODELS + AZURE_REGIONAL_MODELS:
for model in GPT_5_6_MODELS + AZURE_GLOBAL_MODELS + AZURE_REGIONAL_MODELS + BEDROCK_MANTLE_MODELS:
assert backup_cost.get(model) == main_cost.get(model), (
f"{model} differs between main and backup model cost maps"
)