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]

test_openai_image_edit_cost_tracking

Ishaan Jafferee2b51b2d08a
diff --git a/tests/image_gen_tests/test_image_edits.py b/tests/image_gen_tests/test_image_edits.py
index 68acb7ac7fc..6914c7a37ab 100644
--- a/tests/image_gen_tests/test_image_edits.py
+++ b/tests/image_gen_tests/test_image_edits.py
@@ -322,14 +322,23 @@ async def test_openai_image_edit_cost_tracking():
litellm.logging_callback_manager._reset_all_callbacks()
litellm.callbacks = [test_custom_logger]
- # Mock response for Azure image edit
+ # Mock response for Azure image edit with usage data for cost tracking
mock_response = {
"created": 1589478378,
"data": [
{
"b64_json": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg=="
}
- ]
+ ],
+ "usage": {
+ "total_tokens": 1100,
+ "input_tokens": 100,
+ "input_tokens_details": {
+ "image_tokens": 50,
+ "text_tokens": 50
+ },
+ "output_tokens": 1000
+ }
}
class MockResponse: