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]

fix /spend logs call

Ishaan Jaff06857d108df0
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 6a99d2a4493..bddba054afe 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -251,7 +251,7 @@ jobs:
command: |
pwd
ls
- python -m pytest -vv tests/ -x --junitxml=test-results/junit.xml --durations=5 --ignore=tests/otel_tests --ignore=tests/pass_through_tests
+ python -m pytest -s -vv tests/ -x --junitxml=test-results/junit.xml --durations=5 --ignore=tests/otel_tests --ignore=tests/pass_through_tests
no_output_timeout: 120m
# Store test results
diff --git a/tests/pass_through_tests/test_vertex_ai.py b/tests/pass_through_tests/test_vertex_ai.py
index 0b980b33424..675557098f6 100644
--- a/tests/pass_through_tests/test_vertex_ai.py
+++ b/tests/pass_through_tests/test_vertex_ai.py
@@ -10,6 +10,7 @@ import tempfile
import json
import os
import pytest
+import asyncio
# Path to your service account JSON file
@@ -59,13 +60,13 @@ def load_vertex_ai_credentials():
async def call_spend_logs_endpoint():
"""
Call this
- curl -X GET "http://0.0.0.0:4000/spend/logs?start_date={}" -H "Authorization: Bearer sk-1234"
+ curl -X GET "http://0.0.0.0:4000/spend/logs" -H "Authorization: Bearer sk-1234"
"""
import datetime
import requests
todays_date = datetime.datetime.now().strftime("%Y-%m-%d")
- url = f"http://0.0.0.0:4000/spend/logs?start_date={todays_date}"
+ url = f"http://0.0.0.0:4000/global/spend/logs"
headers = {"Authorization": f"Bearer sk-1234"}
response = requests.get(url, headers=headers)
print("response from call_spend_logs_endpoint", response)
@@ -91,6 +92,7 @@ async def test_basic_vertex_ai_pass_through_with_spendlog():
print("response", response)
+ await asyncio.sleep(3)
_spend_logs_response = await call_spend_logs_endpoint()
print("spend logs response", _spend_logs_response)