litellm icon indicating copy to clipboard operation
litellm copied to clipboard

[Bug]: Empty response when trying to get spend logs

Open VfBfoerst opened this issue 10 months ago • 1 comments

What happened?

I am getting an empty response when calling the /spend/logs api.
e.g.

curl -X 'GET'   'http://localhost:4000/spend/logs?api_key=sk-1234&start_date=2024-04-04&end_date=2024-04-05'   -H 'accept: application/json'   -H 'Authorization: Bearer sk-1234'

We need to determine the amount of spent tokens, not only the costs. What is the best way to do so?

Relevant log output

Output of above curl command:  
  

[]

Twitter / LinkedIn details

No response

VfBfoerst avatar Apr 08 '24 12:04 VfBfoerst

Is there a way to export the usage directly, based on the user/api/team keys, as for example a csv or pdf file to analyze the usage?

VfBfoerst avatar Apr 08 '24 12:04 VfBfoerst

please use this endpoint for spend reporting @VfBfoerst https://docs.litellm.ai/docs/proxy/cost_tracking#api-endpoints-to-get-spend

ishaan-jaff avatar Jun 19 '24 03:06 ishaan-jaff