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]

add tests to check ai21 models cost is calculated correct

Ishaan Jafffdaaea9b0d81
diff --git a/litellm/tests/test_amazing_vertex_completion.py b/litellm/tests/test_amazing_vertex_completion.py
index a4238995dcb..ec76d2cb093 100644
--- a/litellm/tests/test_amazing_vertex_completion.py
+++ b/litellm/tests/test_amazing_vertex_completion.py
@@ -2555,3 +2555,7 @@ async def test_partner_models_httpx_ai21():
assert response.usage.total_tokens == 194
print(f"response: {response}")
+
+ print("hidden params from response=", response._hidden_params)
+
+ assert response._hidden_params["response_cost"] > 0