Tags

Global View Spend Tags

LiteLLM Enterprise - View Spend Per Request Tag. Used by LiteLLM UI

Example Request:

curl -X GET "http://0.0.0.0:4000/spend/tags" -H "Authorization: Bearer sk-1234"

Spend with Start Date and End Date

curl -X GET "http://0.0.0.0:4000/spend/tags?start_date=2022-01-01&end_date=2022-02-01" -H "Authorization: Bearer sk-1234"
GET/global/spend/tags
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/tags', {
    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"
  }
]