For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DiscordPlatform
DocumentationIntegrationsAPI referenceSDKsChangelog
DocumentationIntegrationsAPI referenceSDKsChangelog
  • Get started
    • Overview
    • Trace your first call
    • Run your first eval
    • Use gateway & prompts
    • Live demo
  • Features
    • Users
  • Admin
    • API keys
    • Provider keys
    • Workspaces & projects
    • Collaborate
  • Resources
      • Span Attributes
      • Error handling
      • API rate limits
  • Security & Support
    • Support
    • Status
LogoLogo
DiscordPlatform
On this page
  • Input & Output
  • Metrics
  • Identifiers & metadata
  • Tracing
  • Status & errors
  • LLM configuration
  • Annotations & Evaluation
  • Other
  • Trace hierarchy
  • OpenTelemetry semantic conventions
  • GenAI conventions
  • Traceloop conventions
  • OpenInference conventions
  • Respan-specific attributes
ResourcesReference

Span Attributes

Complete reference of all span attributes and tracing attributes.
Was this page helpful?
Previous

Error handling

Next
Built with

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.

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)
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.

Sub-fieldTypeDescription
blockbooleanIf false, server returns immediately without awaiting log completion

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

AttributeDescription
gen_ai.systemProvider identifier ("openai", "anthropic", "google")
gen_ai.request.modelRequested model name
gen_ai.response.modelActual model used in response
gen_ai.request.temperatureTemperature setting
gen_ai.request.max_tokensMax tokens setting
gen_ai.usage.prompt_tokensPrompt/input token count
gen_ai.usage.completion_tokensCompletion/output token count
gen_ai.usage.cache_read_input_tokensCached input tokens
llm.request.typeRequest type ("chat", "completion", "embedding")
llm.usage.total_tokensTotal token count
llm.usage.reasoning_tokensReasoning tokens
llm.is_streamingWhether response was streamed

Traceloop conventions

AttributeDescription
traceloop.span.kindSpan type: "workflow", "task", "tool", "agent"
traceloop.entity.pathHierarchical span path
traceloop.entity.inputSpan input content
traceloop.entity.outputSpan output content
traceloop.workflow.nameWorkflow name

OpenInference conventions

OpenInference spans are auto-enriched by Respan into the GenAI/Traceloop equivalents above.

OpenInference AttributeMapped to
openinference.span.kindtraceloop.span.kind
llm.model_namegen_ai.request.model
llm.token_count.promptgen_ai.usage.prompt_tokens
llm.token_count.completiongen_ai.usage.completion_tokens
input.valuetraceloop.entity.input
output.valuetraceloop.entity.output

Respan-specific attributes

AttributeDescription
respan.customer_params.customer_identifierCustomer/user identifier
respan.threads.thread_identifierThread/conversation ID
respan.trace.trace_group_identifierGroup related traces
respan.metadataJSON metadata merged into span
respan.environmentEnvironment tag ("prod", "staging")
respan.entity.log_methodHow the span was created ("ts_tracing", "python_tracing", "logging_api")
respan.entity.log_typeSpan type for Respan processing