Span Attributes
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
input
string / object / array — Universal input to the model. Required. Format depends on the log type.
output
string / object / array — Model’s response. Required. Format depends on the log type.
prompt_messages
array — (Legacy) Messages sent to the model. Use input instead.
completion_message
object — (Legacy) Final assistant message. Use output instead.
full_request
object — Complete request payload sent to the provider. Tool calls and function definitions are auto-extracted.
full_response
object — Full response object from the provider.
Metrics
start_time
string — Request start time in RFC3339 format (e.g. "2025-09-08T07:46:14.007279Z").
timestamp
string — Request end time in RFC3339 format.
latency
number — Total request latency in seconds.
time_to_first_token
number — Time to first token in seconds. Useful for measuring streaming responsiveness.
tokens_per_second
number — Output token throughput (tokens per second).
cost
number — Total request cost in USD. Auto-calculated from model and token counts if omitted.
usage
object — Token usage breakdown.
prompt_cache_hit_tokens
integer — Number of tokens served from cache.
prompt_cache_creation_tokens
integer — Number of tokens added to cache.
reasoning_tokens
integer — Reasoning tokens used (subset of completion_tokens). Applies to models with chain-of-thought reasoning (e.g., o3, gpt-5).
routing_time
number — Time spent on routing/preprocessing in seconds.
prompt_unit_price
number — Custom price per 1M prompt tokens. Use for self-hosted or fine-tuned models.
completion_unit_price
number — Custom price per 1M completion tokens.
Identifiers & metadata
unique_id
string — Unique identifier for the log. Auto-generated if not provided.
model
string — Model name (e.g. "gpt-4o", "claude-3-5-sonnet-20240620"). Required.
log_type
string — Type of log. Defaults to "chat". See Log types.
provider_id
string — Provider identifier (e.g. "openai", "anthropic").
environment
string — Runtime environment (e.g. "test", "prod"). Used to separate test and production data.
customer_identifier
string (max 254 characters) — User or customer-level identifier. Auto-truncated if exceeded. See Customer identifier.
customer_params
object — Extended customer info: customer_identifier, name, email.
metadata
object — Custom key-value pairs for tagging, analytics, and filtering. All values are coerced to strings.
properties
object — Typed metadata that preserves native types (numbers, booleans, nested objects). Unlike metadata, values are not coerced to strings.
custom_identifier
string — Indexed custom identifier for fast querying.
thread_identifier
string — Conversation thread identifier. Logs with the same value are grouped into a thread.
group_identifier
string — Group identifier for related logs.
prompt_id
string — Prompt template identifier. Auto-set when using prompt management.
prompt_name
string — Prompt template name.
prompt_version_number
integer — Prompt version number.
deployment_name
string — Deployment name.
organization_key_id
string — API key identifier used for the request.
Tracing
trace_unique_id
string — Required. Groups all spans into a single trace. All spans sharing this ID form one trace.
span_unique_id
string — Required. Unique identifier for this span within the trace.
span_parent_id
string — Parent span ID. Creates the hierarchical tree structure. Omit or set to null for root spans.
span_name
string — Descriptive name for the operation (e.g. "openai.chat", "retrieval.search").
span_workflow_name
string — The nearest workflow this span belongs to. Used to label the root-level workflow in trace views.
span_path
string — Nested path within the workflow hierarchy.
trace_group_identifier
string — Groups related traces together, even across different sessions or systems.
respan_params
object — Additional Respan parameters passed via the tracing SDK.
Status & errors
status_code
integer — HTTP status code. Defaults to 200.
status
string — Semantic status: "success" or "error".
error_message
string — Error description if the request failed.
warnings
string / object — Non-fatal issues encountered during the request.
LLM configuration
temperature
number — Randomness control (0–2).
max_tokens
integer — Maximum number of tokens to generate.
top_p
number — Nucleus sampling parameter (0–1).
frequency_penalty
number — Penalizes tokens based on frequency (0–2).
presence_penalty
number — Penalizes tokens already present (0–2).
stop
array — Sequences that halt generation.
n
integer — Number of completions to generate.
stream
boolean — Whether the response was streamed.
response_format
object — Output format: text, json_schema, or json_object.
tools
array — Available tool/function definitions.
tool_choice
string / object — Controls tool selection: "none", "auto", or specific tool.
Annotations & Evaluation
positive_feedback
boolean | null — User sentiment annotation. true = positive, false = negative, null = no annotation.
note
string — Annotation note text attached to the span.
scores
object — Map of evaluator scores { evaluator_id: { evaluator_name, evaluator_slug, score_value } }. Sortable and filterable using the scores__ prefix pattern.
Other
tool_calls
array — Tools/functions called by the model in the response.
is_pinned
boolean — Whether the span is pinned (exempt from retention TTL deletion). Pinned spans are preserved indefinitely. Default: false.
blurred
boolean — Whether the span content is blurred for privacy (based on plan’s log retention limits).
disable_log
boolean — When true, omits input/output messages from the log (metrics still recorded).
request_breakdown
boolean — When true, adds detailed metrics (tokens, cost, latency) to the response body.
keywordsai_api_controls
object — Logging behavior controls.
Tracing attributes are a superset of Span Attributes. Every span attribute is also a tracing attribute, plus the fields below for building trace hierarchies and integrating with OpenTelemetry.
Trace hierarchy
trace_unique_id
string — Required. Groups all spans into a single trace. All spans sharing this ID form one trace view.
span_unique_id
string — Required. Unique identifier for this span within the trace.
span_parent_id
string — Parent span ID. Creates the hierarchical tree structure. Omit or set to null for root spans.
span_name
string — Descriptive name for the operation (e.g. "openai.chat", "retrieval.search", "generate_outline").
span_workflow_name
string — The workflow this span belongs to. Labels the root-level workflow in trace views.
span_path
string — Hierarchical path within the workflow (e.g. "content_pipeline.generate_outline"). Auto-set by the tracing SDK decorators.
trace_group_identifier
string — Groups related traces together across sessions or systems.
OpenTelemetry semantic conventions
These attributes are set by tracing SDKs and auto-instrumentation libraries. Respan processes them from OTLP spans at ingestion.
GenAI conventions
Traceloop conventions
OpenInference conventions
OpenInference spans are auto-enriched by Respan into the GenAI/Traceloop equivalents above.
Respan-specific attributes
All Span Attributes
All fields from Span Attributes are also available on traced spans — including input/output, metrics, identifiers, metadata, status, LLM configuration, annotations, and evaluation scores.