Skip to main content

StandardLoggingPayload Specification

Found under kwargs["standard_logging_object"]. This is a standard payload, logged for every successful and failed response.

StandardLoggingPayload​

FieldTypeDescription
idstrUnique identifier
trace_idstrTrace multiple LLM calls belonging to same overall request
call_typestrType of call
response_costfloatCost of the response in USD ($)
response_cost_failure_debug_infoStandardLoggingModelCostFailureDebugInformationDebug information if cost tracking fails
statusStandardLoggingPayloadStatusStatus of the payload
total_tokensintTotal number of tokens
prompt_tokensintNumber of prompt tokens
completion_tokensintNumber of completion tokens
startTimefloatStart time of the call
endTimefloatEnd time of the call
completionStartTimefloatTime to first token for streaming requests
response_timefloatTotal response time. If streaming, this is the time to first token
model_map_informationStandardLoggingModelInformationModel mapping information
modelstrModel name sent in request
model_idOptional[str]Model ID of the deployment used
model_groupOptional[str]model_group used for the request
api_basestrLLM API base URL
metadataStandardLoggingMetadataMetadata information
cache_hitOptional[bool]Whether cache was hit
cache_keyOptional[str]Optional cache key
saved_cache_costfloatCost saved by cache
request_tagslistList of request tags
end_userOptional[str]Optional end user identifier
requester_ip_addressOptional[str]Optional requester IP address
messagesOptional[Union[str, list, dict]]Messages sent in the request
responseOptional[Union[str, list, dict]]LLM response
error_strOptional[str]Optional error string
error_informationOptional[StandardLoggingPayloadErrorInformation]Optional error information
model_parametersdictModel parameters
hidden_paramsStandardLoggingHiddenParamsHidden parameters

StandardLoggingUserAPIKeyMetadata​

FieldTypeDescription
user_api_key_hashOptional[str]Hash of the litellm virtual key
user_api_key_aliasOptional[str]Alias of the API key
user_api_key_org_idOptional[str]Organization ID associated with the key
user_api_key_team_idOptional[str]Team ID associated with the key
user_api_key_user_idOptional[str]User ID associated with the key
user_api_key_team_aliasOptional[str]Team alias associated with the key

StandardLoggingMetadata​

Inherits from StandardLoggingUserAPIKeyMetadata and adds:

FieldTypeDescription
spend_logs_metadataOptional[dict]Key-value pairs for spend logging
requester_ip_addressOptional[str]Requester's IP address
requester_metadataOptional[dict]Additional requester metadata

StandardLoggingAdditionalHeaders​

FieldTypeDescription
x_ratelimit_limit_requestsintRate limit for requests
x_ratelimit_limit_tokensintRate limit for tokens
x_ratelimit_remaining_requestsintRemaining requests in rate limit
x_ratelimit_remaining_tokensintRemaining tokens in rate limit

StandardLoggingHiddenParams​

FieldTypeDescription
model_idOptional[str]Optional model ID
cache_keyOptional[str]Optional cache key
api_baseOptional[str]Optional API base URL
response_costOptional[str]Optional response cost
additional_headersOptional[StandardLoggingAdditionalHeaders]Additional headers

StandardLoggingModelInformation​

FieldTypeDescription
model_map_keystrModel map key
model_map_valueOptional[ModelInfo]Optional model information

StandardLoggingModelCostFailureDebugInformation​

FieldTypeDescription
error_strstrError string
traceback_strstrTraceback string
modelstrModel name
cache_hitOptional[bool]Whether cache was hit
custom_llm_providerOptional[str]Optional custom LLM provider
base_modelOptional[str]Optional base model
call_typestrCall type
custom_pricingOptional[bool]Whether custom pricing was used

StandardLoggingPayloadErrorInformation​

FieldTypeDescription
error_codeOptional[str]Optional error code (eg. "429")
error_classOptional[str]Optional error class (eg. "RateLimitError")
llm_providerOptional[str]LLM provider that returned the error (eg. "openai")`

StandardLoggingPayloadStatus​

A literal type with two possible values:

  • "success"
  • "failure"