Skip to main content

Usage Event Fields

Every request through the proxy generates a normalized usage event with these fields.

Identity & context

FieldTypeDescription
tsstringISO 8601 timestamp
envstringEnvironment tag (dev/prod)
tenant_idstringYour organisation ID
api_key_idstringAPI key identifier
providerstringProvider name (e.g. openai, anthropic)
endpointstringAPI endpoint path
modelstring | nullModel name from request/response
generation_idstring | nullProvider's request ID
streambooleanWhether the request used streaming
outcomestringcompleted, cancelled, or error
usage_sourcestringprovider, estimate, partial, or none
http_statusnumber | nullUpstream HTTP status code

Core token counts

FieldTypeDescription
prompt_tokensnumber | nullInput tokens
completion_tokensnumber | nullOutput tokens
total_tokensnumber | nullTotal tokens

Granular token breakdown

FieldTypeDescriptionProviders
cache_read_tokensnumber | nullTokens served from cache (discounted)OpenAI, Anthropic, Google, xAI
cache_write_tokensnumber | nullTokens written to cacheAnthropic
reasoning_tokensnumber | nullReasoning/thinking tokensOpenAI (o3/o4-mini), Google
prompt_audio_tokensnumber | nullAudio input tokensOpenAI
prompt_image_tokensnumber | nullImage input tokensOpenAI
completion_audio_tokensnumber | nullAudio output tokensOpenAI

Tool use

FieldTypeDescriptionProviders
web_search_requestsnumber | nullWeb searches performedAnthropic

Cost

FieldTypeDescription
provider_costnumber | nullProvider-reported cost (OpenRouter)
total_cost_usdnumber | nullCalculated cost from token counts × pricing

Size metrics

FieldTypeDescription
prompt_charsnumber | nullCharacter count of request body
completion_charsnumber | nullCharacter count of response body
completion_bytesnumber | nullByte count of response body

Timing

FieldTypeDescription
started_at_msnumberTimestamp when request was received
first_byte_at_msnumberTime to first byte from provider
ended_at_msnumberTimestamp when response completed

Attribution

FieldTypeDescription
dimsobject | nullDimension key-value pairs from X-ASO-Dims

Image generation metadata

FieldTypeDescription
image_countnumber | nullNumber of images generated
image_sizestring | nullImage dimensions (e.g. 1024x1024)
image_qualitystring | nullQuality setting (e.g. hd, standard)