From d07d31c8e1c05c16bbc7f5f3ec3e93a7405e6533 Mon Sep 17 00:00:00 2001 From: Marty Sullivan Date: Wed, 23 Sep 2026 02:07:24 -0400 Subject: [PATCH] feat(azure): price GPT-6 Sol and GPT-6 Luna on the azure route An Azure deployment of either model had no azure/ entry, so the cost map answered two different wrong ways. azure/gpt-6-sol and the dated snapshot raised ModelNotMappedError, and azure/us/gpt-6-sol fell through to 0.0, which a proxy records as a real $0.00 spend row. Adds six keys, the Standard Global, dated snapshot and US data zone shapes for each model, following the azure/gpt-6-astra rows PR #39827 landed. Rates are derived from the OpenAI direct rows: parity on the global shape, since Foundry resells generation 6 at OpenAI's list price, and the standard 1.1x on the US data zone. Flex, priority and batch rates are dropped along with /v1/batch, because Azure publishes Std meters only for this generation. supports_max_reasoning_effort is false rather than the true the OpenAI rows carry. A live call to a real deployment of each model answers reasoning_effort max with a 400, "Unsupported value: 'reasoning_effort' does not support 'max' with this model. Supported values are: 'none', 'low', 'medium', 'high', and 'xhigh'.", and xhigh returns 200. That is the same evidence e79f3ec520 acted on for azure/gpt-6-astra, so all three shapes per model now match those rows. No EU data zone row. Microsoft's own DZ meter splits by region for generation 6, $11.00 across seven US regions against $12.00 across fourteen that include nine EU ones, so an EU row is 1.2x rather than the 1.1x azure/eu/gpt-6-astra carries. With no published sol or luna meter there is nothing to cite at either value. Azure's Retail Prices API publishes no meter for either model as of 2026-09-23, so these rates are derived rather than cited, and the PR stays a draft until they can be reconciled against published figures. --- ...odel_prices_and_context_window_backup.json | 288 ++++++++++++++++++ model_prices_and_context_window.json | 288 ++++++++++++++++++ .../test_litellm/test_model_prices_schema.py | 84 +++++ 3 files changed, 660 insertions(+) diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index ae02744b8e10..c6373a7228b5 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -7751,6 +7751,102 @@ "supports_web_search": true, "supports_xhigh_reasoning_effort": true }, + "azure/gpt-6-luna": { + "cache_creation_input_token_cost": 1.25e-07, + "cache_creation_input_token_cost_above_272k_tokens": 2.5e-07, + "cache_read_input_token_cost": 1e-08, + "cache_read_input_token_cost_above_272k_tokens": 2e-08, + "input_cost_per_token": 1e-07, + "input_cost_per_token_above_272k_tokens": 2e-07, + "litellm_provider": "azure", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 5e-07, + "output_cost_per_token_above_272k_tokens": 7.5e-07, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_computer_use": true, + "supports_function_calling": true, + "supports_max_reasoning_effort": false, + "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_cache_breakpoint": 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 + }, + "azure/gpt-6-sol": { + "cache_creation_input_token_cost": 2.5e-06, + "cache_creation_input_token_cost_above_272k_tokens": 5e-06, + "cache_read_input_token_cost": 2e-07, + "cache_read_input_token_cost_above_272k_tokens": 4e-07, + "input_cost_per_token": 2e-06, + "input_cost_per_token_above_272k_tokens": 4e-06, + "litellm_provider": "azure", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1e-05, + "output_cost_per_token_above_272k_tokens": 1.5e-05, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_computer_use": true, + "supports_function_calling": true, + "supports_max_reasoning_effort": false, + "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_cache_breakpoint": 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 + }, "azure/gpt-6-astra-2026-09-03": { "cache_creation_input_token_cost": 1.25e-05, "cache_creation_input_token_cost_above_272k_tokens": 2.5e-05, @@ -7799,6 +7895,102 @@ "supports_web_search": true, "supports_xhigh_reasoning_effort": true }, + "azure/gpt-6-luna-2026-09-22": { + "cache_creation_input_token_cost": 1.25e-07, + "cache_creation_input_token_cost_above_272k_tokens": 2.5e-07, + "cache_read_input_token_cost": 1e-08, + "cache_read_input_token_cost_above_272k_tokens": 2e-08, + "input_cost_per_token": 1e-07, + "input_cost_per_token_above_272k_tokens": 2e-07, + "litellm_provider": "azure", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 5e-07, + "output_cost_per_token_above_272k_tokens": 7.5e-07, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_computer_use": true, + "supports_function_calling": true, + "supports_max_reasoning_effort": false, + "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_cache_breakpoint": 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 + }, + "azure/gpt-6-sol-2026-09-22": { + "cache_creation_input_token_cost": 2.5e-06, + "cache_creation_input_token_cost_above_272k_tokens": 5e-06, + "cache_read_input_token_cost": 2e-07, + "cache_read_input_token_cost_above_272k_tokens": 4e-07, + "input_cost_per_token": 2e-06, + "input_cost_per_token_above_272k_tokens": 4e-06, + "litellm_provider": "azure", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1e-05, + "output_cost_per_token_above_272k_tokens": 1.5e-05, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_computer_use": true, + "supports_function_calling": true, + "supports_max_reasoning_effort": false, + "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_cache_breakpoint": 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 + }, "azure/gpt-chat-latest": { "cache_read_input_token_cost": 5e-07, "deprecation_date": "2026-12-02", @@ -8143,6 +8335,102 @@ "supports_web_search": true, "supports_xhigh_reasoning_effort": true }, + "azure/us/gpt-6-luna": { + "cache_creation_input_token_cost": 1.375e-07, + "cache_creation_input_token_cost_above_272k_tokens": 2.75e-07, + "cache_read_input_token_cost": 1.1e-08, + "cache_read_input_token_cost_above_272k_tokens": 2.2e-08, + "input_cost_per_token": 1.1e-07, + "input_cost_per_token_above_272k_tokens": 2.2e-07, + "litellm_provider": "azure", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 5.5e-07, + "output_cost_per_token_above_272k_tokens": 8.25e-07, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_computer_use": true, + "supports_function_calling": true, + "supports_max_reasoning_effort": false, + "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_cache_breakpoint": 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 + }, + "azure/us/gpt-6-sol": { + "cache_creation_input_token_cost": 2.75e-06, + "cache_creation_input_token_cost_above_272k_tokens": 5.5e-06, + "cache_read_input_token_cost": 2.2e-07, + "cache_read_input_token_cost_above_272k_tokens": 4.4e-07, + "input_cost_per_token": 2.2e-06, + "input_cost_per_token_above_272k_tokens": 4.4e-06, + "litellm_provider": "azure", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.1e-05, + "output_cost_per_token_above_272k_tokens": 1.65e-05, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_computer_use": true, + "supports_function_calling": true, + "supports_max_reasoning_effort": false, + "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_cache_breakpoint": 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 + }, "azure/us/gpt-chat-latest": { "cache_read_input_token_cost": 5.5e-07, "deprecation_date": "2026-12-02", diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index ae02744b8e10..c6373a7228b5 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -7751,6 +7751,102 @@ "supports_web_search": true, "supports_xhigh_reasoning_effort": true }, + "azure/gpt-6-luna": { + "cache_creation_input_token_cost": 1.25e-07, + "cache_creation_input_token_cost_above_272k_tokens": 2.5e-07, + "cache_read_input_token_cost": 1e-08, + "cache_read_input_token_cost_above_272k_tokens": 2e-08, + "input_cost_per_token": 1e-07, + "input_cost_per_token_above_272k_tokens": 2e-07, + "litellm_provider": "azure", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 5e-07, + "output_cost_per_token_above_272k_tokens": 7.5e-07, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_computer_use": true, + "supports_function_calling": true, + "supports_max_reasoning_effort": false, + "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_cache_breakpoint": 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 + }, + "azure/gpt-6-sol": { + "cache_creation_input_token_cost": 2.5e-06, + "cache_creation_input_token_cost_above_272k_tokens": 5e-06, + "cache_read_input_token_cost": 2e-07, + "cache_read_input_token_cost_above_272k_tokens": 4e-07, + "input_cost_per_token": 2e-06, + "input_cost_per_token_above_272k_tokens": 4e-06, + "litellm_provider": "azure", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1e-05, + "output_cost_per_token_above_272k_tokens": 1.5e-05, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_computer_use": true, + "supports_function_calling": true, + "supports_max_reasoning_effort": false, + "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_cache_breakpoint": 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 + }, "azure/gpt-6-astra-2026-09-03": { "cache_creation_input_token_cost": 1.25e-05, "cache_creation_input_token_cost_above_272k_tokens": 2.5e-05, @@ -7799,6 +7895,102 @@ "supports_web_search": true, "supports_xhigh_reasoning_effort": true }, + "azure/gpt-6-luna-2026-09-22": { + "cache_creation_input_token_cost": 1.25e-07, + "cache_creation_input_token_cost_above_272k_tokens": 2.5e-07, + "cache_read_input_token_cost": 1e-08, + "cache_read_input_token_cost_above_272k_tokens": 2e-08, + "input_cost_per_token": 1e-07, + "input_cost_per_token_above_272k_tokens": 2e-07, + "litellm_provider": "azure", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 5e-07, + "output_cost_per_token_above_272k_tokens": 7.5e-07, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_computer_use": true, + "supports_function_calling": true, + "supports_max_reasoning_effort": false, + "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_cache_breakpoint": 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 + }, + "azure/gpt-6-sol-2026-09-22": { + "cache_creation_input_token_cost": 2.5e-06, + "cache_creation_input_token_cost_above_272k_tokens": 5e-06, + "cache_read_input_token_cost": 2e-07, + "cache_read_input_token_cost_above_272k_tokens": 4e-07, + "input_cost_per_token": 2e-06, + "input_cost_per_token_above_272k_tokens": 4e-06, + "litellm_provider": "azure", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1e-05, + "output_cost_per_token_above_272k_tokens": 1.5e-05, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_computer_use": true, + "supports_function_calling": true, + "supports_max_reasoning_effort": false, + "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_cache_breakpoint": 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 + }, "azure/gpt-chat-latest": { "cache_read_input_token_cost": 5e-07, "deprecation_date": "2026-12-02", @@ -8143,6 +8335,102 @@ "supports_web_search": true, "supports_xhigh_reasoning_effort": true }, + "azure/us/gpt-6-luna": { + "cache_creation_input_token_cost": 1.375e-07, + "cache_creation_input_token_cost_above_272k_tokens": 2.75e-07, + "cache_read_input_token_cost": 1.1e-08, + "cache_read_input_token_cost_above_272k_tokens": 2.2e-08, + "input_cost_per_token": 1.1e-07, + "input_cost_per_token_above_272k_tokens": 2.2e-07, + "litellm_provider": "azure", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 5.5e-07, + "output_cost_per_token_above_272k_tokens": 8.25e-07, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_computer_use": true, + "supports_function_calling": true, + "supports_max_reasoning_effort": false, + "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_cache_breakpoint": 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 + }, + "azure/us/gpt-6-sol": { + "cache_creation_input_token_cost": 2.75e-06, + "cache_creation_input_token_cost_above_272k_tokens": 5.5e-06, + "cache_read_input_token_cost": 2.2e-07, + "cache_read_input_token_cost_above_272k_tokens": 4.4e-07, + "input_cost_per_token": 2.2e-06, + "input_cost_per_token_above_272k_tokens": 4.4e-06, + "litellm_provider": "azure", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.1e-05, + "output_cost_per_token_above_272k_tokens": 1.65e-05, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_computer_use": true, + "supports_function_calling": true, + "supports_max_reasoning_effort": false, + "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_cache_breakpoint": 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 + }, "azure/us/gpt-chat-latest": { "cache_read_input_token_cost": 5.5e-07, "deprecation_date": "2026-12-02", diff --git a/tests/test_litellm/test_model_prices_schema.py b/tests/test_litellm/test_model_prices_schema.py index 052278631e21..231d140f7950 100644 --- a/tests/test_litellm/test_model_prices_schema.py +++ b/tests/test_litellm/test_model_prices_schema.py @@ -478,3 +478,87 @@ def test_unregistered_provider_guard_flags_only_labels_nobody_registered(): "unknown_root-new_family_models", "vertex_ai-new_family_models", ] + + +AZURE_GEN_6_RESOLD_MODELS: Final = ("gpt-6-sol", "gpt-6-luna") +AZURE_GEN_6_SNAPSHOT: Final = "2026-09-22" +AZURE_US_DATA_ZONE_UPLIFT: Final = 1.1 +# Azure publishes Std meters only for generation 6, so an entry that kept OpenAI's flex, priority +# or batch rates would quote a tier no Azure request can be served at. +AZURE_UNSOLD_RATE_SUFFIXES: Final = ("_batches", "_flex", "_priority") + + +def rate_fields(entry: Mapping[str, object]) -> frozenset[str]: + return frozenset(field for field in entry if "_cost_per_token" in field or "_token_cost" in field) + + +@pytest.mark.parametrize("model", AZURE_GEN_6_RESOLD_MODELS) +def test_azure_gen_6_global_row_prices_every_rate_at_its_openai_row(prices: dict, model: str): + """Azure's Standard Global sheet resells these at the same per-token rate OpenAI charges, which + is how azure/gpt-6-astra's Gl rates relate to gpt-6-astra's. Comparing the two rows rather than + pinning a number means this fails on a drift in either direction and survives a repricing that + moves both together.""" + azure_row: Final = prices[f"azure/{model}"] + openai_row: Final = prices[model] + drifted: Final = [ + f"azure/{model}.{field}: {azure_row[field]} != {openai_row[field]}" + for field in sorted(rate_fields(azure_row)) + if azure_row[field] != openai_row[field] + ] + assert drifted == [] + + +@pytest.mark.parametrize("model", AZURE_GEN_6_RESOLD_MODELS) +def test_azure_gen_6_rows_omit_the_service_tiers_azure_does_not_sell(prices: dict, model: str): + """The OpenAI rows carry flex, priority and batch rates. Carrying them onto an Azure row would + price a tier a request can never reach, and the /v1/batch endpoint has to go with them.""" + keys: Final = (f"azure/{model}", f"azure/{model}-{AZURE_GEN_6_SNAPSHOT}", f"azure/us/{model}") + unsold: Final = sorted( + f"{key}.{field}" + for key in keys + for field in rate_fields(prices[key]) + if field.endswith(AZURE_UNSOLD_RATE_SUFFIXES) + ) + assert unsold == [] + assert [key for key in keys if "/v1/batch" in prices[key]["supported_endpoints"]] == [] + + +@pytest.mark.parametrize("model", AZURE_GEN_6_RESOLD_MODELS) +def test_azure_gen_6_us_data_zone_row_uplifts_every_rate_the_global_row_sets(prices: dict, model: str): + """A data-zone row is the global row times one uplift applied to every rate. Leaving a field at + the global number under-bills exactly that rate on a data-zone deployment, and the field sets + have to match or a rate goes missing rather than wrong.""" + global_row: Final = prices[f"azure/{model}"] + zone_row: Final = prices[f"azure/us/{model}"] + assert rate_fields(zone_row) == rate_fields(global_row) + drifted: Final = [ + f"azure/us/{model}.{field}: {zone_row[field]} != {global_row[field]} * {AZURE_US_DATA_ZONE_UPLIFT}" + for field in sorted(rate_fields(global_row)) + if abs(zone_row[field] - global_row[field] * AZURE_US_DATA_ZONE_UPLIFT) + > global_row[field] * AZURE_US_DATA_ZONE_UPLIFT * 1e-9 + ] + assert drifted == [] + + +@pytest.mark.parametrize("model", AZURE_GEN_6_RESOLD_MODELS) +def test_azure_gen_6_dated_snapshot_prices_the_same_as_its_undated_row(prices: dict, model: str): + """An Azure deployment of these reports the dated model string. _strip_model_name already falls + back to the undated row, so the dated key is a spelling rather than the only way to price a call, + and the whole value of carrying one is that it agrees with the row it stands in for. Drift is the + only way it can hurt: the same deployment would then bill two ways depending on the spelling.""" + assert prices[f"azure/{model}-{AZURE_GEN_6_SNAPSHOT}"] == prices[f"azure/{model}"] + + +@pytest.mark.parametrize("model", AZURE_GEN_6_RESOLD_MODELS) +def test_azure_gen_6_rows_do_not_advertise_the_reasoning_effort_azure_refuses(prices: dict, model: str): + """Azure answers reasoning_effort=max on a generation-6 deployment with a 400 naming none, low, + medium, high and xhigh as the values it takes, while the OpenAI rows for the same models accept + max. The flag is opt-in, so a row that inherits OpenAI's true advertises a level every Azure + request 400s on. Probed live against a real deployment of each model on 2026-09-23, the same way + e79f3ec520 established it for gpt-6-astra.""" + keys: Final = (f"azure/{model}", f"azure/{model}-{AZURE_GEN_6_SNAPSHOT}", f"azure/us/{model}") + offered: Final = { + key: resolve_supported_reasoning_efforts(prices[key], deployment_is_mapped=True) or () for key in keys + } + assert [key for key, efforts in offered.items() if "max" in efforts] == [] + assert [key for key, efforts in offered.items() if "xhigh" not in efforts] == []