diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 62e576ea0f7..69d1ec0d25d 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -26296,6 +26296,25 @@ "supports_function_calling": true, "supports_response_schema": false }, + "oci/xai.grok-4.3": { + "cache_read_input_token_cost": 2e-07, + "cache_read_input_token_cost_above_200k_tokens": 4e-07, + "input_cost_per_token": 1.25e-06, + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "litellm_provider": "oci", + "max_input_tokens": 1000000, + "max_output_tokens": 1000000, + "max_tokens": 1000000, + "mode": "chat", + "output_cost_per_token": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "source": "https://docs.oracle.com/en-us/iaas/Content/generative-ai/xai-grok-4-3.htm", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": false, + "supports_vision": true + }, "oci/xai.grok-code-fast-1": { "input_cost_per_token": 5e-06, "litellm_provider": "oci", diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 62553e46ac1..35ea62f37ed 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -26438,6 +26438,25 @@ "supports_function_calling": true, "supports_response_schema": false }, + "oci/xai.grok-4.3": { + "cache_read_input_token_cost": 2e-07, + "cache_read_input_token_cost_above_200k_tokens": 4e-07, + "input_cost_per_token": 1.25e-06, + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "litellm_provider": "oci", + "max_input_tokens": 1000000, + "max_output_tokens": 1000000, + "max_tokens": 1000000, + "mode": "chat", + "output_cost_per_token": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "source": "https://docs.oracle.com/en-us/iaas/Content/generative-ai/xai-grok-4-3.htm", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": false, + "supports_vision": true + }, "oci/xai.grok-code-fast-1": { "input_cost_per_token": 5e-06, "litellm_provider": "oci", diff --git a/tests/test_litellm/test_oci_xai_grok_4_3_model_metadata.py b/tests/test_litellm/test_oci_xai_grok_4_3_model_metadata.py new file mode 100644 index 00000000000..c95eca5375a --- /dev/null +++ b/tests/test_litellm/test_oci_xai_grok_4_3_model_metadata.py @@ -0,0 +1,52 @@ +import json +from pathlib import Path + + +def test_oci_xai_grok_4_3_model_info(): + json_path = Path(__file__).parents[2] / "model_prices_and_context_window.json" + with open(json_path) as f: + model_cost = json.load(f) + + model = "oci/xai.grok-4.3" + 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"] == "oci" + assert info["mode"] == "chat" + + assert info["input_cost_per_token"] == 1.25e-06 + assert info["output_cost_per_token"] == 2.5e-06 + assert info["cache_read_input_token_cost"] == 2e-07 + + assert info["input_cost_per_token_above_200k_tokens"] == 2.5e-06 + assert info["output_cost_per_token_above_200k_tokens"] == 5e-06 + assert info["cache_read_input_token_cost_above_200k_tokens"] == 4e-07 + + assert info["max_input_tokens"] == 1000000 + assert info["max_output_tokens"] == 1000000 + assert info["max_tokens"] == 1000000 + + assert info["supports_function_calling"] is True + assert info["supports_vision"] is True + assert info["supports_prompt_caching"] is True + assert info["supports_reasoning"] is True + assert info["supports_response_schema"] is False + + +def test_oci_xai_grok_4_3_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) + + model = "oci/xai.grok-4.3" + assert backup_cost.get(model) == main_cost.get( + model + ), f"{model} differs between main and backup model cost maps"