View Spend Logs
[DEPRECATED] This endpoint is not paginated and can cause performance issues. Please use /spend/logs/v2 instead for paginated access to spend logs.
Row results are capped at 10,000 most recent entries per response.
View all spend logs, if request_id is provided, only logs for that request_id will be returned
When start_date and end_date are provided:
- summarize=true (default): Returns aggregated spend data grouped by date (maintains backward compatibility)
- summarize=false: Returns filtered individual log entries within the date range
Example Request for all logs
curl -X GET "http://0.0.0.0:8000/spend/logs" -H "Authorization: Bearer sk-1234"
Example Request for specific request_id
curl -X GET "http://0.0.0.0:8000/spend/logs?request_id=chatcmpl-6dcb2540-d3d7-4e49-bb27-291f863f112e" -H "Authorization: Bearer sk-1234"
Example Request for specific api_key
curl -X GET "http://0.0.0.0:8000/spend/logs?api_key=d5345c0ecc68ae6295c69f91926b2bd379e25481a40c34b5884d157a9f65d8fa" -H "Authorization: Bearer sk-1234"
Example Request for specific user_id
curl -X GET "http://0.0.0.0:8000/spend/logs?user_id=ishaan@berri.ai" -H "Authorization: Bearer sk-1234"
Example Request for date range with individual logs (unsummarized)
curl -X GET "http://0.0.0.0:8000/spend/logs?start_date=2024-01-01&end_date=2024-01-02&summarize=false" -H "Authorization: Bearer sk-1234"
Request
- Base URL: https://apiclaw.biz (the document declares no server; this is the origin it was published from)
- URL: https://apiclaw.biz/spend/logs
- Auth: API key in header x-litellm-api-key
Query parameters
Get spend logs based on api key
Get spend logs based on user_id
request_id to get spend logs for specific request_id. If none passed then pass spend logs for all requests
Time from which to start viewing key spend
Time till which to view key spend
When start_date and end_date are provided, summarize=true returns aggregated data by date (legacy behavior), summarize=false returns filtered individual logs
Response
Successful Response
Changes
No recorded changes to this operation across all 1 revision of this API.