Usage Event Fields
Every request through the proxy generates a normalized usage event with these fields.
Identity & context
| Field | Type | Description |
|---|---|---|
ts | string | ISO 8601 timestamp |
env | string | Environment tag (dev/prod) |
tenant_id | string | Your organisation ID |
api_key_id | string | API key identifier |
provider | string | Provider name (e.g. openai, anthropic) |
endpoint | string | API endpoint path |
model | string | null | Model name from request/response |
generation_id | string | null | Provider's request ID |
stream | boolean | Whether the request used streaming |
outcome | string | completed, cancelled, or error |
usage_source | string | provider, estimate, partial, or none |
http_status | number | null | Upstream HTTP status code |
Core token counts
| Field | Type | Description |
|---|---|---|
prompt_tokens | number | null | Input tokens |
completion_tokens | number | null | Output tokens |
total_tokens | number | null | Total tokens |
Granular token breakdown
| Field | Type | Description | Providers |
|---|---|---|---|
cache_read_tokens | number | null | Tokens served from cache (discounted) | OpenAI, Anthropic, Google, xAI |
cache_write_tokens | number | null | Tokens written to cache | Anthropic |
reasoning_tokens | number | null | Reasoning/thinking tokens | OpenAI (o3/o4-mini), Google |
prompt_audio_tokens | number | null | Audio input tokens | OpenAI |
prompt_image_tokens | number | null | Image input tokens | OpenAI |
completion_audio_tokens | number | null | Audio output tokens | OpenAI |
Tool use
| Field | Type | Description | Providers |
|---|---|---|---|
web_search_requests | number | null | Web searches performed | Anthropic |
Cost
| Field | Type | Description |
|---|---|---|
provider_cost | number | null | Provider-reported cost (OpenRouter) |
calculated_cost | number | null | Cost calculated from token counts × pricing rates |
total_cost_usd | number | null | Final cost in USD (provider_cost if available, otherwise calculated_cost) |
cost_source | string | How cost was determined: provider, custom, standard, or none |
pricing_matched | boolean | Whether a pricing entry was found for this model |
pricing_model | string | null | Canonical model name after alias resolution |
Size metrics
| Field | Type | Description |
|---|---|---|
prompt_chars | number | null | Character count of request body |
completion_chars | number | null | Character count of response body |
completion_bytes | number | null | Byte count of response body |
Timing
| Field | Type | Description |
|---|---|---|
started_at_ms | number | Timestamp when request was received |
first_byte_at_ms | number | Time to first byte from provider |
ended_at_ms | number | Timestamp when response completed |
Attribution
| Field | Type | Description |
|---|---|---|
dims | object | null | Dimension key-value pairs from X-ASO-Dims |
dims_invalid | boolean | Whether the dimensions failed validation |
groupable_dims | object | null | Subset of dimensions safe for aggregation/grouping |
Image generation metadata
| Field | Type | Description |
|---|---|---|
image_count | number | null | Number of images generated |
image_size | string | null | Image dimensions (e.g. 1024x1024) |
image_quality | string | null | Quality setting (e.g. hd, standard) |
Data retention
| Field | Type | Description |
|---|---|---|
retention_tier | string | null | Data retention tier (e.g. 2y) based on subscription plan |