Skip to main content
Every span contains these fields regardless of log type. Fields are automatically populated when using the LLM Gateway, or you can set them manually via the logging endpoint. For usage guides, see Log fields & parameters and Tracing parameters.

Input & Output

string / object / array — Universal input to the model. Required. Format depends on the log type.
string / object / array — Model’s response. Required. Format depends on the log type.
array — (Legacy) Messages sent to the model. Use input instead.
object — (Legacy) Final assistant message. Use output instead.
object — Complete request payload sent to the provider. Tool calls and function definitions are auto-extracted.
object — Full response object from the provider.

Metrics

string — Request start time in RFC3339 format (e.g. "2025-09-08T07:46:14.007279Z").
string — Request end time in RFC3339 format.
number — Total request latency in seconds.
number — Time to first token in seconds. Useful for measuring streaming responsiveness.
number — Output token throughput (tokens per second).
number — Total request cost in USD. Auto-calculated from model and token counts if omitted.
object — Token usage breakdown.
Sub-fieldTypeDescription
prompt_tokensintegerTokens in the prompt/input
completion_tokensintegerTokens in the model output
total_tokensintegerSum of prompt and completion tokens
prompt_tokens_detailsobjectGranular token breakdown (e.g., cached tokens)
integer — Number of tokens served from cache.
integer — Number of tokens added to cache.
number — Custom price per 1M prompt tokens. Use for self-hosted or fine-tuned models.
number — Custom price per 1M completion tokens.

Identifiers & metadata

string — Unique identifier for the log. Auto-generated if not provided.
string — Model name (e.g. "gpt-4o", "claude-3-5-sonnet-20240620"). Required.
string — Type of log. Defaults to "chat". See Log types.
string — Provider identifier (e.g. "openai", "anthropic").
string — Runtime environment (e.g. "test", "prod"). Used to separate test and production data.
string — User or customer-level identifier. See Customer identifier.
object — Extended customer info: customer_identifier, name, email.
object — Custom key-value pairs for tagging, analytics, and filtering.
string — Indexed custom identifier for fast querying.
string — Conversation thread identifier. Logs with the same value are grouped into a thread.
string — Group identifier for related logs.
string — Prompt template identifier. Auto-set when using prompt management.
string — Prompt template name.
integer — Prompt version number.
string — Deployment name.
string — API key identifier used for the request.

Tracing

stringRequired. Groups all spans into a single trace. All spans sharing this ID form one trace.
stringRequired. Unique identifier for this span within the trace.
string — Parent span ID. Creates the hierarchical tree structure. Omit or set to null for root spans.
string — Descriptive name for the operation (e.g. "openai.chat", "retrieval.search").
string — The nearest workflow this span belongs to. Used to label the root-level workflow in trace views.
string — Nested path within the workflow hierarchy.
string — Groups related traces together, even across different sessions or systems.
object — Additional Respan parameters passed via the tracing SDK.

Status & errors

integer — HTTP status code. Defaults to 200.
string — Semantic status: "success" or "error".
string — Error description if the request failed.
string / object — Non-fatal issues encountered during the request.

LLM configuration

number — Randomness control (0–2).
integer — Maximum number of tokens to generate.
number — Nucleus sampling parameter (0–1).
number — Penalizes tokens based on frequency (0–2).
number — Penalizes tokens already present (0–2).
array — Sequences that halt generation.
integer — Number of completions to generate.
boolean — Whether the response was streamed.
object — Output format: text, json_schema, or json_object.
array — Available tool/function definitions.
string / object — Controls tool selection: "none", "auto", or specific tool.

Other

boolean — User sentiment. true = positive, false = negative.
object — Logging behavior controls.
Sub-fieldTypeDescription
blockbooleanIf false, server returns immediately without awaiting log completion