Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

feat(models): add GPT-5.6 (sol/terra/luna) pricing and metadata (#32659)

devin-ai-integration[bot]a874de6ac60a
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json
index db534b52df9..a111f301d11 100644
--- a/litellm/model_prices_and_context_window_backup.json
+++ b/litellm/model_prices_and_context_window_backup.json
@@ -22273,6 +22273,218 @@
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": true
},
+ "gpt-5.6": {
+ "cache_creation_input_token_cost": 6.25e-06,
+ "cache_creation_input_token_cost_above_272k_tokens": 1.25e-05,
+ "cache_creation_input_token_cost_flex": 3.125e-06,
+ "cache_creation_input_token_cost_priority": 1.25e-05,
+ "cache_read_input_token_cost": 5e-07,
+ "cache_read_input_token_cost_above_272k_tokens": 1e-06,
+ "cache_read_input_token_cost_flex": 2.5e-07,
+ "cache_read_input_token_cost_priority": 1e-06,
+ "input_cost_per_token": 5e-06,
+ "input_cost_per_token_above_272k_tokens": 1e-05,
+ "input_cost_per_token_batches": 2.5e-06,
+ "input_cost_per_token_flex": 2.5e-06,
+ "input_cost_per_token_priority": 1e-05,
+ "litellm_provider": "openai",
+ "max_input_tokens": 1050000,
+ "max_output_tokens": 128000,
+ "max_tokens": 128000,
+ "mode": "chat",
+ "output_cost_per_token": 3e-05,
+ "output_cost_per_token_above_272k_tokens": 4.5e-05,
+ "output_cost_per_token_batches": 1.5e-05,
+ "output_cost_per_token_flex": 1.5e-05,
+ "output_cost_per_token_priority": 6e-05,
+ "regional_processing_uplift_multiplier_eu": 1.1,
+ "regional_processing_uplift_multiplier_us": 1.1,
+ "supported_endpoints": [
+ "/v1/chat/completions",
+ "/v1/batch",
+ "/v1/responses"
+ ],
+ "supported_modalities": [
+ "text",
+ "image"
+ ],
+ "supported_output_modalities": [
+ "text"
+ ],
+ "supports_function_calling": true,
+ "supports_minimal_reasoning_effort": false,
+ "supports_native_streaming": true,
+ "supports_none_reasoning_effort": true,
+ "supports_parallel_function_calling": true,
+ "supports_pdf_input": true,
+ "supports_prompt_caching": true,
+ "supports_reasoning": true,
+ "supports_response_schema": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true,
+ "supports_vision": true,
+ "supports_web_search": true,
+ "supports_xhigh_reasoning_effort": true
+ },
+ "gpt-5.6-sol": {
+ "cache_creation_input_token_cost": 6.25e-06,
+ "cache_creation_input_token_cost_above_272k_tokens": 1.25e-05,
+ "cache_creation_input_token_cost_flex": 3.125e-06,
+ "cache_creation_input_token_cost_priority": 1.25e-05,
+ "cache_read_input_token_cost": 5e-07,
+ "cache_read_input_token_cost_above_272k_tokens": 1e-06,
+ "cache_read_input_token_cost_flex": 2.5e-07,
+ "cache_read_input_token_cost_priority": 1e-06,
+ "input_cost_per_token": 5e-06,
+ "input_cost_per_token_above_272k_tokens": 1e-05,
+ "input_cost_per_token_batches": 2.5e-06,
+ "input_cost_per_token_flex": 2.5e-06,
+ "input_cost_per_token_priority": 1e-05,
+ "litellm_provider": "openai",
+ "max_input_tokens": 1050000,
+ "max_output_tokens": 128000,
+ "max_tokens": 128000,
+ "mode": "chat",
+ "output_cost_per_token": 3e-05,
+ "output_cost_per_token_above_272k_tokens": 4.5e-05,
+ "output_cost_per_token_batches": 1.5e-05,
+ "output_cost_per_token_flex": 1.5e-05,
+ "output_cost_per_token_priority": 6e-05,
+ "regional_processing_uplift_multiplier_eu": 1.1,
+ "regional_processing_uplift_multiplier_us": 1.1,
+ "supported_endpoints": [
+ "/v1/chat/completions",
+ "/v1/batch",
+ "/v1/responses"
+ ],
+ "supported_modalities": [
+ "text",
+ "image"
+ ],
+ "supported_output_modalities": [
+ "text"
+ ],
+ "supports_function_calling": true,
+ "supports_minimal_reasoning_effort": false,
+ "supports_native_streaming": true,
+ "supports_none_reasoning_effort": true,
+ "supports_parallel_function_calling": true,
+ "supports_pdf_input": true,
+ "supports_prompt_caching": true,
+ "supports_reasoning": true,
+ "supports_response_schema": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true,
+ "supports_vision": true,
+ "supports_web_search": true,
+ "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,
+ "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,
+ "regional_processing_uplift_multiplier_eu": 1.1,
+ "regional_processing_uplift_multiplier_us": 1.1,
+ "supported_endpoints": [
+ "/v1/chat/completions",
+ "/v1/batch",
+ "/v1/responses"
+ ],
+ "supported_modalities": [
+ "text",
+ "image"
+ ],
+ "supported_output_modalities": [
+ "text"
+ ],
+ "supports_function_calling": true,
+ "supports_minimal_reasoning_effort": false,
+ "supports_native_streaming": true,
+ "supports_none_reasoning_effort": true,
+ "supports_parallel_function_calling": true,
+ "supports_pdf_input": true,
+ "supports_prompt_caching": true,
+ "supports_reasoning": true,
+ "supports_response_schema": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true,
+ "supports_vision": true,
+ "supports_web_search": true,
+ "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,
+ "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,
+ "regional_processing_uplift_multiplier_eu": 1.1,
+ "regional_processing_uplift_multiplier_us": 1.1,
+ "supported_endpoints": [
+ "/v1/chat/completions",
+ "/v1/batch",
+ "/v1/responses"
+ ],
+ "supported_modalities": [
+ "text",
+ "image"
+ ],
+ "supported_output_modalities": [
+ "text"
+ ],
+ "supports_function_calling": true,
+ "supports_minimal_reasoning_effort": false,
+ "supports_native_streaming": true,
+ "supports_none_reasoning_effort": true,
+ "supports_parallel_function_calling": true,
+ "supports_pdf_input": true,
+ "supports_prompt_caching": true,
+ "supports_reasoning": true,
+ "supports_response_schema": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true,
+ "supports_vision": true,
+ "supports_web_search": true,
+ "supports_xhigh_reasoning_effort": true
+ },
"gpt-5.5": {
"cache_read_input_token_cost": 5e-07,
"cache_read_input_token_cost_above_272k_tokens": 1e-06,
diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json
index 363ba9842b0..d6e4a265da0 100644
--- a/model_prices_and_context_window.json
+++ b/model_prices_and_context_window.json
@@ -22431,6 +22431,218 @@
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": true
},
+ "gpt-5.6": {
+ "cache_creation_input_token_cost": 6.25e-06,
+ "cache_creation_input_token_cost_above_272k_tokens": 1.25e-05,
+ "cache_creation_input_token_cost_flex": 3.125e-06,
+ "cache_creation_input_token_cost_priority": 1.25e-05,
+ "cache_read_input_token_cost": 5e-07,
+ "cache_read_input_token_cost_above_272k_tokens": 1e-06,
+ "cache_read_input_token_cost_flex": 2.5e-07,
+ "cache_read_input_token_cost_priority": 1e-06,
+ "input_cost_per_token": 5e-06,
+ "input_cost_per_token_above_272k_tokens": 1e-05,
+ "input_cost_per_token_batches": 2.5e-06,
+ "input_cost_per_token_flex": 2.5e-06,
+ "input_cost_per_token_priority": 1e-05,
+ "litellm_provider": "openai",
+ "max_input_tokens": 1050000,
+ "max_output_tokens": 128000,
+ "max_tokens": 128000,
+ "mode": "chat",
+ "output_cost_per_token": 3e-05,
+ "output_cost_per_token_above_272k_tokens": 4.5e-05,
+ "output_cost_per_token_batches": 1.5e-05,
+ "output_cost_per_token_flex": 1.5e-05,
+ "output_cost_per_token_priority": 6e-05,
+ "regional_processing_uplift_multiplier_eu": 1.1,
+ "regional_processing_uplift_multiplier_us": 1.1,
+ "supported_endpoints": [
+ "/v1/chat/completions",
+ "/v1/batch",
+ "/v1/responses"
+ ],
+ "supported_modalities": [
+ "text",
+ "image"
+ ],
+ "supported_output_modalities": [
+ "text"
+ ],
+ "supports_function_calling": true,
+ "supports_minimal_reasoning_effort": false,
+ "supports_native_streaming": true,
+ "supports_none_reasoning_effort": true,
+ "supports_parallel_function_calling": true,
+ "supports_pdf_input": true,
+ "supports_prompt_caching": true,
+ "supports_reasoning": true,
+ "supports_response_schema": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true,
+ "supports_vision": true,
+ "supports_web_search": true,
+ "supports_xhigh_reasoning_effort": true
+ },
+ "gpt-5.6-sol": {
+ "cache_creation_input_token_cost": 6.25e-06,
+ "cache_creation_input_token_cost_above_272k_tokens": 1.25e-05,
+ "cache_creation_input_token_cost_flex": 3.125e-06,
+ "cache_creation_input_token_cost_priority": 1.25e-05,
+ "cache_read_input_token_cost": 5e-07,
+ "cache_read_input_token_cost_above_272k_tokens": 1e-06,
+ "cache_read_input_token_cost_flex": 2.5e-07,
+ "cache_read_input_token_cost_priority": 1e-06,
+ "input_cost_per_token": 5e-06,
+ "input_cost_per_token_above_272k_tokens": 1e-05,
+ "input_cost_per_token_batches": 2.5e-06,
+ "input_cost_per_token_flex": 2.5e-06,
+ "input_cost_per_token_priority": 1e-05,
+ "litellm_provider": "openai",
+ "max_input_tokens": 1050000,
+ "max_output_tokens": 128000,
+ "max_tokens": 128000,
+ "mode": "chat",
+ "output_cost_per_token": 3e-05,
+ "output_cost_per_token_above_272k_tokens": 4.5e-05,
+ "output_cost_per_token_batches": 1.5e-05,
+ "output_cost_per_token_flex": 1.5e-05,
+ "output_cost_per_token_priority": 6e-05,
+ "regional_processing_uplift_multiplier_eu": 1.1,
+ "regional_processing_uplift_multiplier_us": 1.1,
+ "supported_endpoints": [
+ "/v1/chat/completions",
+ "/v1/batch",
+ "/v1/responses"
+ ],
+ "supported_modalities": [
+ "text",
+ "image"
+ ],
+ "supported_output_modalities": [
+ "text"
+ ],
+ "supports_function_calling": true,
+ "supports_minimal_reasoning_effort": false,
+ "supports_native_streaming": true,
+ "supports_none_reasoning_effort": true,
+ "supports_parallel_function_calling": true,
+ "supports_pdf_input": true,
+ "supports_prompt_caching": true,
+ "supports_reasoning": true,
+ "supports_response_schema": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true,
+ "supports_vision": true,
+ "supports_web_search": true,
+ "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,
+ "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,
+ "regional_processing_uplift_multiplier_eu": 1.1,
+ "regional_processing_uplift_multiplier_us": 1.1,
+ "supported_endpoints": [
+ "/v1/chat/completions",
+ "/v1/batch",
+ "/v1/responses"
+ ],
+ "supported_modalities": [
+ "text",
+ "image"
+ ],
+ "supported_output_modalities": [
+ "text"
+ ],
+ "supports_function_calling": true,
+ "supports_minimal_reasoning_effort": false,
+ "supports_native_streaming": true,
+ "supports_none_reasoning_effort": true,
+ "supports_parallel_function_calling": true,
+ "supports_pdf_input": true,
+ "supports_prompt_caching": true,
+ "supports_reasoning": true,
+ "supports_response_schema": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true,
+ "supports_vision": true,
+ "supports_web_search": true,
+ "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,
+ "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,
+ "regional_processing_uplift_multiplier_eu": 1.1,
+ "regional_processing_uplift_multiplier_us": 1.1,
+ "supported_endpoints": [
+ "/v1/chat/completions",
+ "/v1/batch",
+ "/v1/responses"
+ ],
+ "supported_modalities": [
+ "text",
+ "image"
+ ],
+ "supported_output_modalities": [
+ "text"
+ ],
+ "supports_function_calling": true,
+ "supports_minimal_reasoning_effort": false,
+ "supports_native_streaming": true,
+ "supports_none_reasoning_effort": true,
+ "supports_parallel_function_calling": true,
+ "supports_pdf_input": true,
+ "supports_prompt_caching": true,
+ "supports_reasoning": true,
+ "supports_response_schema": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true,
+ "supports_vision": true,
+ "supports_web_search": true,
+ "supports_xhigh_reasoning_effort": true
+ },
"gpt-5.5": {
"cache_read_input_token_cost": 5e-07,
"cache_read_input_token_cost_above_272k_tokens": 1e-06,
diff --git a/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py b/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py
index 0e6c6061b46..dcc359ceff4 100644
--- a/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py
+++ b/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py
@@ -507,6 +507,61 @@ def test_generic_cost_per_token_gpt55_pro():
)
+ "model,input_cost,output_cost,cache_read_cost,cache_write_cost",
+ [
+ ("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),
+ ],
+)
+def test_generic_cost_per_token_gpt56(
+ model, input_cost, output_cost, cache_read_cost, cache_write_cost
+):
+ """gpt-5.6 (sol/terra/luna): base pricing + new cache-write cost.
+
+ Cache writes are billed at 1.25x the uncached input rate for this family.
+ """
+ custom_llm_provider = "openai"
+ os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True"
+ litellm.model_cost = litellm.get_model_cost_map(url="")
+
+ model_cost_map = litellm.model_cost[model]
+
+ assert model_cost_map["input_cost_per_token"] == input_cost
+ assert model_cost_map["output_cost_per_token"] == output_cost
+ assert model_cost_map["cache_read_input_token_cost"] == cache_read_cost
+ assert model_cost_map["cache_creation_input_token_cost"] == cache_write_cost
+ assert model_cost_map["litellm_provider"] == "openai"
+ assert model_cost_map["mode"] == "chat"
+ assert model_cost_map["cache_creation_input_token_cost"] == pytest.approx(
+ input_cost * 1.25
+ )
+ assert model_cost_map["max_input_tokens"] == 1050000
+ assert model_cost_map["input_cost_per_token_above_272k_tokens"] == pytest.approx(
+ input_cost * 2
+ )
+ assert model_cost_map["output_cost_per_token_above_272k_tokens"] == pytest.approx(
+ output_cost * 1.5
+ )
+
+ prompt_tokens = 1000
+ completion_tokens = 500
+ usage = Usage(
+ prompt_tokens=prompt_tokens,
+ completion_tokens=completion_tokens,
+ total_tokens=prompt_tokens + completion_tokens,
+ )
+ prompt_cost, completion_cost = generic_cost_per_token(
+ model=model,
+ usage=usage,
+ custom_llm_provider=custom_llm_provider,
+ )
+ assert round(prompt_cost, 10) == round(input_cost * prompt_tokens, 10)
+ assert round(completion_cost, 10) == round(output_cost * completion_tokens, 10)
+
+
@pytest.mark.parametrize(
"model,expected_none,expected_xhigh,expected_minimal",
[
diff --git a/tests/test_litellm/llms/openai/test_is_model_gpt_5_model.py b/tests/test_litellm/llms/openai/test_is_model_gpt_5_model.py
index 02dd9dade0a..1095819c98c 100644
--- a/tests/test_litellm/llms/openai/test_is_model_gpt_5_model.py
+++ b/tests/test_litellm/llms/openai/test_is_model_gpt_5_model.py
@@ -50,6 +50,10 @@ GPT5_MODELS = [
"gpt-5.5-pro",
"gpt-5.5-2026-04-23", # dated variant
"gpt-5.5-pro-2026-04-23", # dated variant
+ "gpt-5.6",
+ "gpt-5.6-sol",
+ "gpt-5.6-terra",
+ "gpt-5.6-luna",
"gpt-5.1-chat", # versioned chat — THE KEY REGRESSION CASE
"gpt-5.2-chat", # versioned chat — also a regression case
"gpt-5.3-chat", # versioned chat — THE KEY REGRESSION CASE
@@ -112,6 +116,45 @@ class TestOpenAIGPT5ConfigIsModelGpt5Model:
), f"Expected '{model}' (gpt-5-chat family) NOT to be on the GPT-5 path"
+# Models that are gpt-5.4 or newer. main.py gates the automatic switch to the
+# /v1/responses bridge (when reasoning_effort is set and tools are passed) on
+# is_model_gpt_5_4_plus_model, so the gpt-5.6 family must land on the True side.
+GPT5_4_PLUS_MODELS = [
+ "gpt-5.4",
+ "gpt-5.5",
+ "gpt-5.5-pro",
+ "gpt-5.6",
+ "gpt-5.6-sol",
+ "gpt-5.6-terra",
+ "gpt-5.6-luna",
+ "openai/gpt-5.6-sol",
+]
+
+GPT5_PRE_5_4_MODELS = [
+ "gpt-5",
+ "gpt-5.1",
+ "gpt-5.2",
+ "gpt-5.3",
+ "gpt-5.3-chat",
+ "gpt-4o",
+]
+
+
+class TestOpenAIGPT5ConfigIsModelGpt54PlusModel:
+
+ @pytest.mark.parametrize("model", GPT5_4_PLUS_MODELS)
+ def test_gpt5_4_plus_models_are_classified_as_5_4_plus(self, model: str):
+ assert OpenAIGPT5Config.is_model_gpt_5_4_plus_model(
+ model
+ ), f"Expected '{model}' to be classified as gpt-5.4-or-newer"
+
+ @pytest.mark.parametrize("model", GPT5_PRE_5_4_MODELS)
+ def test_pre_5_4_models_are_not_classified_as_5_4_plus(self, model: str):
+ assert not OpenAIGPT5Config.is_model_gpt_5_4_plus_model(
+ model
+ ), f"Expected '{model}' NOT to be classified as gpt-5.4-or-newer"
+
+
# ---------------------------------------------------------------------------
# AzureOpenAIGPT5Config
# ---------------------------------------------------------------------------
diff --git a/tests/test_litellm/test_gpt_5_6_model_metadata.py b/tests/test_litellm/test_gpt_5_6_model_metadata.py
new file mode 100644
index 00000000000..30a0777f477
--- /dev/null
+++ b/tests/test_litellm/test_gpt_5_6_model_metadata.py
@@ -0,0 +1,79 @@
+import json
+from pathlib import Path
+
+import pytest
+
+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 = {
+ "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),
+ "gpt-5.6-luna": (1e-06, 6e-06, 1e-07, 1.25e-06),
+}
+
+
[email protected]("model", GPT_5_6_MODELS)
+def test_openai_gpt_5_6_model_info(model):
+ json_path = Path(__file__).parents[2] / "model_prices_and_context_window.json"
+ with open(json_path) as f:
+ model_cost = json.load(f)
+
+ 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"] == "openai"
+ assert info["mode"] == "chat"
+
+ input_cost, output_cost, cache_read_cost, cache_write_cost = 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
+ assert info["cache_creation_input_token_cost"] == cache_write_cost
+ assert info["cache_creation_input_token_cost"] == pytest.approx(input_cost * 1.25)
+
+ assert info["input_cost_per_token_above_272k_tokens"] == pytest.approx(input_cost * 2)
+ assert info["output_cost_per_token_above_272k_tokens"] == pytest.approx(output_cost * 1.5)
+ assert info["cache_read_input_token_cost_above_272k_tokens"] == pytest.approx(cache_read_cost * 2)
+
+ assert info["max_input_tokens"] == 1050000
+ assert info["max_output_tokens"] == 128000
+ assert info["max_tokens"] == 128000
+
+ assert info["supports_function_calling"] is True
+ assert info["supports_prompt_caching"] is True
+ assert info["supports_reasoning"] is True
+ assert info["supports_response_schema"] is True
+ assert info["supports_tool_choice"] is True
+ assert info["supports_vision"] is True
+ assert info["supports_web_search"] is True
+ assert info["supports_none_reasoning_effort"] is True
+ assert info["supports_xhigh_reasoning_effort"] is True
+ assert info["supports_minimal_reasoning_effort"] is False
+
+ assert info["supported_endpoints"] == ["/v1/chat/completions", "/v1/batch", "/v1/responses"]
+ assert info["supported_modalities"] == ["text", "image"]
+ assert info["supported_output_modalities"] == ["text"]
+
+ routed_model, provider, _, _ = get_llm_provider(model=f"openai/{model}")
+ assert routed_model == model
+ assert provider == "openai"
+
+
+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]
+ main_path = repo_root / "model_prices_and_context_window.json"
+ backup_path = repo_root / "litellm" / "model_prices_and_context_window_backup.json"
+
+ with open(main_path) as f:
+ main_cost = json.load(f)
+ with open(backup_path) as f:
+ backup_cost = json.load(f)
+
+ for model in GPT_5_6_MODELS:
+ assert backup_cost.get(model) == main_cost.get(model), (
+ f"{model} differs between main and backup model cost maps"
+ )
diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.py
index 053fe970d3e..47be8cb2eec 100644
--- a/tests/test_litellm/test_utils.py
+++ b/tests/test_litellm/test_utils.py
@@ -710,6 +710,9 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
"cache_creation_input_token_cost": {"type": "number"},
"cache_creation_input_token_cost_above_1hr": {"type": "number"},
"cache_creation_input_token_cost_above_200k_tokens": {"type": "number"},
+ "cache_creation_input_token_cost_above_272k_tokens": {"type": "number"},
+ "cache_creation_input_token_cost_flex": {"type": "number"},
+ "cache_creation_input_token_cost_priority": {"type": "number"},
"cache_read_input_token_cost": {"type": "number"},
"cache_read_input_token_cost_above_200k_tokens": {"type": "number"},
"cache_read_input_token_cost_above_272k_tokens": {"type": "number"},