Budget & Spend Tracking

View Spend Logs

get

View all spend logs, if request_id is provided, only logs for that request_id will be returned

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=sk-Fn8Ej39NkBQmUagFEoUWPQ" -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"
Authorizations
x-llm-api-keystringRequired

Bearer token

Query parameters
api_keyany ofOptional

Get spend logs based on api key

stringOptional
or
nullOptional
user_idany ofOptional

Get spend logs based on user_id

stringOptional
or
nullOptional
request_idany ofOptional

request_id to get spend logs for specific request_id. If none passed then pass spend logs for all requests

stringOptional
or
nullOptional
start_dateany ofOptional

Time from which to start viewing key spend

stringOptional
or
nullOptional
end_dateany ofOptional

Time till which to view key spend

stringOptional
or
nullOptional
Responses
chevron-right
200

Successful Response

application/json
get
/spend/logs

Last updated