From 319193604cfccb1092a17f58ec4ca049115da446 Mon Sep 17 00:00:00 2001 From: Mateo Wang <277851410+mateo-berri@users.noreply.github.com> Date: Fri, 24 Apr 2026 18:10:21 -0700 Subject: [PATCH 1/3] [Feat] Add azure/gpt-5.5 + azure/gpt-5.5-pro entries (+ dated variants) (#26361) * feat(azure): add azure/gpt-5.5 + azure/gpt-5.5-pro entries (+ dated variants) Azure variants of OpenAI's GPT-5.5 family. Microsoft has not yet shipped GPT-5.5 on Azure OpenAI (latest GA on the Foundry models page is GPT-5.4 as of 2026-04-24), but adding the entries day-0 mirrors the established precedent for azure/gpt-5.4* (which were in the cost map before the Azure rollout) so cost tracking and capability flags work the moment customers deploy. Schema follows the existing azure/gpt-5.4* shape: - Same base/long-context pricing as openai/gpt-5.5*: $5/$30 chat, $60/$360 pro per 1M, with priority tier 2x base - Azure variants drop the flex/batches keys (Azure has no flex tier) but keep priority pricing, matching gpt-5.4* precedent - mode=chat for the thinking model, mode=responses for pro reasoning_effort capability flags mirror the OpenAI variants exactly since Azure proxies the same API contract: minimal rejection on both chat and pro, low/none rejection on pro. Once #26456 (which sets supports_low_reasoning_effort + minimal=false on openai/gpt-5.5*) lands, OpenAI and Azure flag profiles align. Tests pin entry presence + pricing for all four Azure variants and verify the live-API-derived reasoning_effort flags. * test: register supports_low_reasoning_effort in cost-map JSON schema azure/gpt-5.5-pro and azure/gpt-5.5-pro-2026-04-23 added in this branch carry supports_low_reasoning_effort=false. The strict 'additionalProperties: false' schema in test_aaamodel_prices_and_context_window_json_is_valid rejected the new key. Register it alongside the other supports_*_reasoning_effort entries. Note: the runtime side of this flag (code that reads it) lands in #26456. Until that PR merges the flag is inert for both Azure and OpenAI pro entries, but having the schema accept it lets cost-map tests pass on either merge order. --- ...odel_prices_and_context_window_backup.json | 163 ++++++++++++++++++ model_prices_and_context_window.json | 163 ++++++++++++++++++ .../llm_cost_calc/test_llm_cost_calc_utils.py | 57 ++++++ tests/test_litellm/test_utils.py | 1 + 4 files changed, 384 insertions(+) diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index f6de40717d..5cccd5f00a 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -4645,6 +4645,169 @@ "supports_vision": true, "supports_web_search": true }, + "azure/gpt-5.5": { + "cache_read_input_token_cost": 5e-07, + "cache_read_input_token_cost_above_272k_tokens": 1e-06, + "cache_read_input_token_cost_priority": 1e-06, + "cache_read_input_token_cost_above_272k_tokens_priority": 2e-06, + "input_cost_per_token": 5e-06, + "input_cost_per_token_above_272k_tokens": 1e-05, + "input_cost_per_token_priority": 1e-05, + "input_cost_per_token_above_272k_tokens_priority": 2e-05, + "litellm_provider": "azure", + "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_priority": 6e-05, + "output_cost_per_token_above_272k_tokens_priority": 9e-05, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/batch", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_function_calling": true, + "supports_native_streaming": 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_service_tier": true, + "supports_vision": true, + "supports_web_search": true, + "supports_none_reasoning_effort": true, + "supports_xhigh_reasoning_effort": true, + "supports_minimal_reasoning_effort": false + }, + "azure/gpt-5.5-2026-04-23": { + "cache_read_input_token_cost": 5e-07, + "cache_read_input_token_cost_above_272k_tokens": 1e-06, + "cache_read_input_token_cost_priority": 1e-06, + "cache_read_input_token_cost_above_272k_tokens_priority": 2e-06, + "input_cost_per_token": 5e-06, + "input_cost_per_token_above_272k_tokens": 1e-05, + "input_cost_per_token_priority": 1e-05, + "input_cost_per_token_above_272k_tokens_priority": 2e-05, + "litellm_provider": "azure", + "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_priority": 6e-05, + "output_cost_per_token_above_272k_tokens_priority": 9e-05, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/batch", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_function_calling": true, + "supports_native_streaming": 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_service_tier": true, + "supports_vision": true, + "supports_web_search": true + }, + "azure/gpt-5.5-pro": { + "cache_read_input_token_cost": 6e-06, + "cache_read_input_token_cost_above_272k_tokens": 1.2e-05, + "input_cost_per_token": 6e-05, + "input_cost_per_token_above_272k_tokens": 0.00012, + "litellm_provider": "azure", + "max_input_tokens": 1050000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "responses", + "output_cost_per_token": 0.00036, + "output_cost_per_token_above_272k_tokens": 0.00054, + "supported_endpoints": [ + "/v1/batch", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_function_calling": true, + "supports_native_streaming": true, + "supports_parallel_function_calling": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": false, + "supports_system_messages": true, + "supports_tool_choice": true, + "supports_vision": true, + "supports_web_search": true, + "supports_none_reasoning_effort": false, + "supports_xhigh_reasoning_effort": true, + "supports_minimal_reasoning_effort": false, + "supports_low_reasoning_effort": false + }, + "azure/gpt-5.5-pro-2026-04-23": { + "cache_read_input_token_cost": 6e-06, + "cache_read_input_token_cost_above_272k_tokens": 1.2e-05, + "input_cost_per_token": 6e-05, + "input_cost_per_token_above_272k_tokens": 0.00012, + "litellm_provider": "azure", + "max_input_tokens": 1050000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "responses", + "output_cost_per_token": 0.00036, + "output_cost_per_token_above_272k_tokens": 0.00054, + "supported_endpoints": [ + "/v1/batch", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_function_calling": true, + "supports_native_streaming": true, + "supports_parallel_function_calling": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": false, + "supports_system_messages": true, + "supports_tool_choice": true, + "supports_vision": true, + "supports_web_search": true + }, "azure/gpt-5.4-mini": { "cache_read_input_token_cost": 7.5e-08, "input_cost_per_token": 7.5e-07, diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index c8ed58ff3e..4d8f3a984f 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -4659,6 +4659,169 @@ "supports_vision": true, "supports_web_search": true }, + "azure/gpt-5.5": { + "cache_read_input_token_cost": 5e-07, + "cache_read_input_token_cost_above_272k_tokens": 1e-06, + "cache_read_input_token_cost_priority": 1e-06, + "cache_read_input_token_cost_above_272k_tokens_priority": 2e-06, + "input_cost_per_token": 5e-06, + "input_cost_per_token_above_272k_tokens": 1e-05, + "input_cost_per_token_priority": 1e-05, + "input_cost_per_token_above_272k_tokens_priority": 2e-05, + "litellm_provider": "azure", + "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_priority": 6e-05, + "output_cost_per_token_above_272k_tokens_priority": 9e-05, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/batch", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_function_calling": true, + "supports_native_streaming": 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_service_tier": true, + "supports_vision": true, + "supports_web_search": true, + "supports_none_reasoning_effort": true, + "supports_xhigh_reasoning_effort": true, + "supports_minimal_reasoning_effort": false + }, + "azure/gpt-5.5-2026-04-23": { + "cache_read_input_token_cost": 5e-07, + "cache_read_input_token_cost_above_272k_tokens": 1e-06, + "cache_read_input_token_cost_priority": 1e-06, + "cache_read_input_token_cost_above_272k_tokens_priority": 2e-06, + "input_cost_per_token": 5e-06, + "input_cost_per_token_above_272k_tokens": 1e-05, + "input_cost_per_token_priority": 1e-05, + "input_cost_per_token_above_272k_tokens_priority": 2e-05, + "litellm_provider": "azure", + "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_priority": 6e-05, + "output_cost_per_token_above_272k_tokens_priority": 9e-05, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/batch", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_function_calling": true, + "supports_native_streaming": 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_service_tier": true, + "supports_vision": true, + "supports_web_search": true + }, + "azure/gpt-5.5-pro": { + "cache_read_input_token_cost": 6e-06, + "cache_read_input_token_cost_above_272k_tokens": 1.2e-05, + "input_cost_per_token": 6e-05, + "input_cost_per_token_above_272k_tokens": 0.00012, + "litellm_provider": "azure", + "max_input_tokens": 1050000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "responses", + "output_cost_per_token": 0.00036, + "output_cost_per_token_above_272k_tokens": 0.00054, + "supported_endpoints": [ + "/v1/batch", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_function_calling": true, + "supports_native_streaming": true, + "supports_parallel_function_calling": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": false, + "supports_system_messages": true, + "supports_tool_choice": true, + "supports_vision": true, + "supports_web_search": true, + "supports_none_reasoning_effort": false, + "supports_xhigh_reasoning_effort": true, + "supports_minimal_reasoning_effort": false, + "supports_low_reasoning_effort": false + }, + "azure/gpt-5.5-pro-2026-04-23": { + "cache_read_input_token_cost": 6e-06, + "cache_read_input_token_cost_above_272k_tokens": 1.2e-05, + "input_cost_per_token": 6e-05, + "input_cost_per_token_above_272k_tokens": 0.00012, + "litellm_provider": "azure", + "max_input_tokens": 1050000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "responses", + "output_cost_per_token": 0.00036, + "output_cost_per_token_above_272k_tokens": 0.00054, + "supported_endpoints": [ + "/v1/batch", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_function_calling": true, + "supports_native_streaming": true, + "supports_parallel_function_calling": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": false, + "supports_system_messages": true, + "supports_tool_choice": true, + "supports_vision": true, + "supports_web_search": true + }, "azure/gpt-5.4-mini": { "cache_read_input_token_cost": 7.5e-08, "input_cost_per_token": 7.5e-07, 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 5e37e2a342..3016762043 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 @@ -449,6 +449,63 @@ def test_gpt55_dated_variants_match_base_reasoning_effort_capabilities( ) +@pytest.mark.parametrize( + "model,expected_mode,expected_input,expected_output,expected_cache_read", + [ + ("azure/gpt-5.5", "chat", 5e-6, 3e-5, 5e-7), + ("azure/gpt-5.5-2026-04-23", "chat", 5e-6, 3e-5, 5e-7), + ("azure/gpt-5.5-pro", "responses", 6e-5, 3.6e-4, 6e-6), + ("azure/gpt-5.5-pro-2026-04-23", "responses", 6e-5, 3.6e-4, 6e-6), + ], +) +def test_azure_gpt55_entries_present_with_correct_pricing( + model, expected_mode, expected_input, expected_output, expected_cache_read +): + """Day-0 Azure entries for GPT-5.5 mirror the OpenAI pricing structure. + + Pricing parity with openai/gpt-5.5* (verified against OpenAI's pricing page + on 2026-04-24): $5/$30 input/output per 1M for chat, $60/$360 for pro. + Cache discount is 10% of input. + """ + os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True" + litellm.model_cost = litellm.get_model_cost_map(url="") + + m = litellm.model_cost[model] + assert m["litellm_provider"] == "azure" + assert m["mode"] == expected_mode + assert m["input_cost_per_token"] == expected_input + assert m["output_cost_per_token"] == expected_output + assert m["cache_read_input_token_cost"] == expected_cache_read + # Long-context window inherited from gpt-5.4 / openai gpt-5.5. + assert m["max_input_tokens"] == 1050000 + assert m["max_output_tokens"] == 128000 + + +@pytest.mark.parametrize( + "model,expected_none,expected_minimal,expected_xhigh", + [ + # Mirror live OpenAI API contract (verified via openai/gpt-5.5* on + # 2026-04-24): chat accepts {none, low, medium, high, xhigh} but NOT + # minimal; pro accepts {medium, high, xhigh} only. + # NOTE: openai/gpt-5.5* entries currently set supports_minimal=true on + # main (pre #26456). Once that PR lands, OpenAI + Azure flags align. + ("azure/gpt-5.5", True, False, True), + ("azure/gpt-5.5-pro", False, False, True), + ], +) +def test_azure_gpt55_reasoning_effort_flags_match_live_openai_api( + model, expected_none, expected_minimal, expected_xhigh +): + """Azure entries pin reasoning_effort flags to OpenAI's actual API contract.""" + os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True" + litellm.model_cost = litellm.get_model_cost_map(url="") + + m = litellm.model_cost[model] + assert m.get("supports_none_reasoning_effort") is expected_none + assert m.get("supports_minimal_reasoning_effort") is expected_minimal + assert m.get("supports_xhigh_reasoning_effort") is expected_xhigh + + def test_generic_cost_per_token_anthropic_prompt_caching(): model = "claude-sonnet-4@20250514" usage = Usage( diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.py index dc344a433b..93c61e003d 100644 --- a/tests/test_litellm/test_utils.py +++ b/tests/test_litellm/test_utils.py @@ -769,6 +769,7 @@ def test_aaamodel_prices_and_context_window_json_is_valid(): "uses_embed_content": {"type": "boolean"}, "supports_reasoning": {"type": "boolean"}, "supports_minimal_reasoning_effort": {"type": "boolean"}, + "supports_low_reasoning_effort": {"type": "boolean"}, "supports_none_reasoning_effort": {"type": "boolean"}, "supports_xhigh_reasoning_effort": {"type": "boolean"}, "supports_max_reasoning_effort": {"type": "boolean"}, From 30cb459d1c924f84a01bb5338b9c37819946dd21 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Sat, 25 Apr 2026 14:34:59 -0700 Subject: [PATCH 2/3] fix: broaden RAG ingestion config cleanup to cover AWS endpoint/identity fields Mirrors the existing api_base handling in _load_credentials_from_config(): when a vector_store_config references litellm_credential_name and the stored credential does not itself define aws_sts_endpoint or aws_web_identity_token, any caller-supplied value on those keys is removed. Keeps endpoint and identity fields aligned with the credential definition. --- litellm/rag/ingestion/base_ingestion.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/litellm/rag/ingestion/base_ingestion.py b/litellm/rag/ingestion/base_ingestion.py index 1317c557d6..f66fc2a6c5 100644 --- a/litellm/rag/ingestion/base_ingestion.py +++ b/litellm/rag/ingestion/base_ingestion.py @@ -73,7 +73,7 @@ class BaseRAGIngestion(ABC): This allows users to specify a credential name in the vector_store config which will be resolved from litellm.credential_list. When a stored credential is used, its values take precedence over caller-supplied - equivalents so the api_key / api_base pair stays consistent with the + equivalents so endpoint and identity fields stay consistent with the credential definition. """ from litellm.litellm_core_utils.credential_accessor import CredentialAccessor @@ -87,11 +87,16 @@ class BaseRAGIngestion(ABC): return for key, value in credential_values.items(): self.vector_store_config[key] = value - if ( - "api_base" in self.vector_store_config - and "api_base" not in credential_values + for key in ( + "api_base", + "aws_sts_endpoint", + "aws_web_identity_token", ): - del self.vector_store_config["api_base"] + if ( + key in self.vector_store_config + and key not in credential_values + ): + del self.vector_store_config[key] @property def custom_llm_provider(self) -> str: From c364c511159132c88e3c963b2ce5cd12a091166a Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Sat, 25 Apr 2026 14:47:54 -0700 Subject: [PATCH 3/3] style: black formatting --- litellm/rag/ingestion/base_ingestion.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/litellm/rag/ingestion/base_ingestion.py b/litellm/rag/ingestion/base_ingestion.py index f66fc2a6c5..1c770d0a99 100644 --- a/litellm/rag/ingestion/base_ingestion.py +++ b/litellm/rag/ingestion/base_ingestion.py @@ -92,10 +92,7 @@ class BaseRAGIngestion(ABC): "aws_sts_endpoint", "aws_web_identity_token", ): - if ( - key in self.vector_store_config - and key not in credential_values - ): + if key in self.vector_store_config and key not in credential_values: del self.vector_store_config[key] @property