Report

Get Global Spend Report

Get Daily Spend per Team, based on specific startTime and endTime. Per team, view usage by each key, model [ { "group-by-day": "2024-05-10", "teams": [ { "team_name": "team-1" "spend": 10, "keys": [ "key": "1213", "usage": { "model-1": { "cost": 12.50, "input_tokens": 1000, "output_tokens": 5000, "requests": 100 }, "audio-modelname1": { "cost": 25.50, "seconds": 25, "requests": 50 }, } } ] ] }

GET/global/spend/report
Authorization
Query parameters
Response

Successful Response

Body
request_id*Request Id
api_key*Api Key
modelModel
api_baseApi Base
call_type*Call Type
spendSpend
total_tokensTotal Tokens
prompt_tokensPrompt Tokens
completion_tokensCompletion Tokens
startTime*Starttime
endTime*Endtime
userUser
metadataMetadata
cache_hitCache Hit
cache_keyCache Key
request_tagsRequest Tags
requester_ip_addressRequester Ip Address
messages*Messages
response*Response
Request
const response = await fetch('/global/spend/report', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
[
  {
    "request_id": "text",
    "api_key": "text",
    "model": "text",
    "api_base": "text",
    "call_type": "text",
    "spend": 0,
    "total_tokens": 0,
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "startTime": "text",
    "endTime": "text",
    "user": "text",
    "cache_hit": "text",
    "cache_key": "text",
    "requester_ip_address": "text",
    "messages": "text",
    "response": "text"
  }
]