diff --git a/litellm/constants.py b/litellm/constants.py index ccbeb260a83..c25e1b9eb31 100644 --- a/litellm/constants.py +++ b/litellm/constants.py @@ -831,7 +831,7 @@ openai_compatible_providers: Final[list] = [ "pinstripes", # Pinstripes - JSON-configured provider "darkbloom", "meta", # Meta Model API (Muse Spark) - JSON-configured provider - "cognition", # Cognition - JSON-configured provider + "cognition", ] openai_text_completion_compatible_providers: Final[list] = [ # providers that support `/v1/completions` "together_ai", diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 5d859a05963..d63a888ae9c 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -48486,9 +48486,9 @@ "source": "https://docs.devin.ai/windsurf/plugins/cascade/models" }, "cognition/swe-1.7": { - "input_cost_per_token": 2.5e-06, - "output_cost_per_token": 1.25e-05, - "cache_read_input_token_cost": 1e-06, + "input_cost_per_token": 5e-07, + "output_cost_per_token": 2.5e-06, + "cache_read_input_token_cost": 2e-07, "litellm_provider": "cognition", "mode": "chat", "supports_function_calling": true, diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 5d859a05963..d63a888ae9c 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -48486,9 +48486,9 @@ "source": "https://docs.devin.ai/windsurf/plugins/cascade/models" }, "cognition/swe-1.7": { - "input_cost_per_token": 2.5e-06, - "output_cost_per_token": 1.25e-05, - "cache_read_input_token_cost": 1e-06, + "input_cost_per_token": 5e-07, + "output_cost_per_token": 2.5e-06, + "cache_read_input_token_cost": 2e-07, "litellm_provider": "cognition", "mode": "chat", "supports_function_calling": true, diff --git a/tests/test_litellm/llms/openai_like/test_cognition_provider.py b/tests/test_litellm/llms/openai_like/test_cognition_provider.py index 26bdfa82944..6dcc02387cc 100644 --- a/tests/test_litellm/llms/openai_like/test_cognition_provider.py +++ b/tests/test_litellm/llms/openai_like/test_cognition_provider.py @@ -114,7 +114,7 @@ class TestCognitionCostTracking: "model, input_cost, output_cost", [ ("cognition/swe-1.6", 5e-07, 2.5e-06), - ("cognition/swe-1.7", 2.5e-06, 1.25e-05), + ("cognition/swe-1.7", 5e-07, 2.5e-06), ], ) def test_cost_map_entries(self, model: str, input_cost: float, output_cost: float): @@ -136,8 +136,8 @@ class TestCognitionCostTracking: custom_llm_provider="cognition", ) - assert prompt_cost == pytest.approx(2.5) - assert completion_cost == pytest.approx(12.5) + assert prompt_cost == pytest.approx(0.5) + assert completion_cost == pytest.approx(2.5) def test_supported_endpoints_matrix(self): matrix = json.loads((Path(litellm.__file__).parent / "provider_endpoints_support_backup.json").read_text()) @@ -169,5 +169,5 @@ class TestCognitionRouting: ) usage = response.usage - expected = usage.prompt_tokens * 2.5e-06 + usage.completion_tokens * 1.25e-05 + expected = usage.prompt_tokens * 5e-07 + usage.completion_tokens * 2.5e-06 assert response._hidden_params["response_cost"] == pytest.approx(expected)