JavaScript APIopeninference-semantic-conventions

Core

Instrumentation

Integrations

JavaScript · Core

@arizeai/openinference-semantic-conventions

This package provides OpenInference semantic conventions for tracing of LLM Applications.

Version
2.17.1

Install

npm install @arizeai/openinference-semantic-conventions

@arizeai/openinference-semantic-conventions

SemanticAttributePrefixes

constantSource ↗
const SemanticAttributePrefixes

Semantic conventions for OpenInference tracing

Properties

NameType
annotations"annotations"
annotation"annotation"
evaluations"evaluations"
evaluation"evaluation"
input"input"
output"output"
llm"llm"
retrieval"retrieval"
reranker"reranker"
messages"messages"
message"message"
document"document"
embedding"embedding"
tool"tool"
tool_call"tool_call"
metadata"metadata"
tag"tag"
session"session"
trace"trace"
user"user"
openinference"openinference"
message_content"message_content"
image"image"
audio"audio"
video"video"
prompt"prompt"
agent"agent"
graph"graph"
decision"decision"

LLMAttributePostfixes

constantSource ↗
const LLMAttributePostfixes

Properties

NameType
provider"provider"
system"system"
model_name"model_name"
request"request"
response"response"
token_count"token_count"
input_messages"input_messages"
output_messages"output_messages"
invocation_parameters"invocation_parameters"
prompts"prompts"
prompt_template"prompt_template"
function_call"function_call"
tools"tools"
cost"cost"
finish_reason"finish_reason"

DecisionAttributePostfixes

constantSource ↗
const DecisionAttributePostfixes

Properties

NameType
provider"provider"
system"system"
model_name"model_name"
request"request"
response"response"
token_count"token_count"

LLMPromptTemplateAttributePostfixes

constantSource ↗
const LLMPromptTemplateAttributePostfixes

Properties

NameType
variables"variables"
template"template"

RetrievalAttributePostfixes

constantSource ↗
const RetrievalAttributePostfixes

Properties

NameType
documents"documents"

RerankerAttributePostfixes

constantSource ↗
const RerankerAttributePostfixes

Properties

NameType
input_documents"input_documents"
output_documents"output_documents"
query"query"
model_name"model_name"
top_k"top_k"

EmbeddingAttributePostfixes

constantSource ↗
const EmbeddingAttributePostfixes

Properties

NameType
embeddings"embeddings"
text"text"
model_name"model_name"
vector"vector"

ToolAttributePostfixes

constantSource ↗
const ToolAttributePostfixes

Properties

NameType
name"name"
description"description"
parameters"parameters"
json_schema"json_schema"
id"id"

MessageAttributePostfixes

constantSource ↗
const MessageAttributePostfixes

Properties

NameType
role"role"
content"content"
contents"contents"
name"name"
function_call_name"function_call_name"
function_call_arguments_json"function_call_arguments_json"
tool_calls"tool_calls"
tool_call_id"tool_call_id"

MessageContentsAttributePostfixes

constantSource ↗
const MessageContentsAttributePostfixes

Properties

NameType
type"type"
text"text"
image"image"
audio"audio"
video"video"
document"document"
id"id"
signature"signature"
data"data"
encrypted_content"encrypted_content"

ImageAttributesPostfixes

constantSource ↗
const ImageAttributesPostfixes

Properties

NameType
url"url"

VideoAttributesPostfixes

constantSource ↗
const VideoAttributesPostfixes

Properties

NameType
url"url"

ToolCallAttributePostfixes

constantSource ↗
const ToolCallAttributePostfixes

Properties

NameType
function_name"function.name"
function_arguments_json"function.arguments"
id"id"
reasoning_signature"reasoning_signature"

DocumentAttributePostfixes

constantSource ↗
const DocumentAttributePostfixes

Properties

NameType
id"id"
content"content"
score"score"
metadata"metadata"
url"url"
mime_type"mime_type"
name"name"

TagAttributePostfixes

constantSource ↗
const TagAttributePostfixes

Properties

NameType
tags"tags"

SessionAttributePostfixes

constantSource ↗
const SessionAttributePostfixes

Properties

NameType
id"id"

UserAttributePostfixes

constantSource ↗
const UserAttributePostfixes

Properties

NameType
id"id"

AudioAttributesPostfixes

constantSource ↗
const AudioAttributesPostfixes

Properties

NameType
url"url"
mime_type"mime_type"
transcript"transcript"

PromptAttributePostfixes

constantSource ↗
const PromptAttributePostfixes

Properties

NameType
vendor"vendor"
id"id"
url"url"

AgentPostfixes

constantSource ↗
const AgentPostfixes

Properties

NameType
name"name"

GraphPostfixes

constantSource ↗
const GraphPostfixes

Properties

NameType
node_id"node.id"
node_name"node.name"
node_parent_id"node.parent_id"

FeedbackAttributePostfixes

constantSource ↗
const FeedbackAttributePostfixes

Properties

NameType
name"name"
score"score"
label"label"
explanation"explanation"
annotator_kind"annotator_kind"
identifier"identifier"
metadata"metadata"

SemanticConventions

constantSource ↗
const SemanticConventions

Properties

NameType
ANNOTATIONS"annotations"
TRACE_ANNOTATIONS"trace.annotations"
SESSION_ANNOTATIONS"session.annotations"
ANNOTATION_NAME"annotation.name"
ANNOTATION_SCORE"annotation.score"
ANNOTATION_LABEL"annotation.label"
ANNOTATION_EXPLANATION"annotation.explanation"
ANNOTATION_ANNOTATOR_KIND"annotation.annotator_kind"
ANNOTATION_IDENTIFIER"annotation.identifier"
ANNOTATION_METADATA"annotation.metadata"
EVALUATIONS"evaluations"
TRACE_EVALUATIONS"trace.evaluations"
SESSION_EVALUATIONS"session.evaluations"
EVALUATION_NAME"evaluation.name"
EVALUATION_SCORE"evaluation.score"
EVALUATION_LABEL"evaluation.label"
EVALUATION_EXPLANATION"evaluation.explanation"
EVALUATION_ANNOTATOR_KIND"evaluation.annotator_kind"
EVALUATION_IDENTIFIER"evaluation.identifier"
EVALUATION_METADATA"evaluation.metadata"
IMAGE_URL"image.url"

The http or base64 link to the image

VIDEO_URL"video.url"

The URL, object-store URI, or base64 data URI of a video.

INPUT_VALUE"input.value"

The input to any span

INPUT_MIME_TYPE"input.mime_type"
INPUT_IMAGES"input.images"

Images passed as input to a span of any kind. Flattened with an index, for example input.images.0.image.url.

INPUT_DOCUMENTS"input.documents"

Documents (e.g. PDFs) passed as input to a span of any kind. Flattened with an index, for example input.documents.0.document.url.

OUTPUT_VALUE"output.value"

The output of any span

OUTPUT_MIME_TYPE"output.mime_type"
OUTPUT_IMAGES"output.images"

Images produced as output by a span of any kind. Flattened with an index, for example output.images.0.image.url.

OUTPUT_DOCUMENTS"output.documents"

Documents (e.g. PDFs) produced as output by a span of any kind. Flattened with an index, for example output.documents.0.document.url.

LLM_INPUT_MESSAGES"llm.input_messages"

The messages sent to the LLM for completions Typically seen in OpenAI chat completions

LLM_OUTPUT_MESSAGES"llm.output_messages"

The messages received from the LLM for completions Typically seen in OpenAI chat completions

LLM_MODEL_NAME"llm.model_name"

The name of the LLM model

LLM_REQUEST_MODEL_NAME"llm.request.model_name"

The model requested by the caller, as sent in the request. May differ from llm.response.model_name when the provider routes the request to a different model (e.g. classifier-triggered fallback).

LLM_RESPONSE_MODEL_NAME"llm.response.model_name"

The model that actually generated the response, as reported by the provider. May differ from llm.request.model_name when the provider routes the request to a different model (e.g. classifier-triggered fallback).

LLM_PROMPTS"llm.prompts"

The prompts sent to the LLM for completions Typically seen in OpenAI legacy completions

LLM_INVOCATION_PARAMETERS"llm.invocation_parameters"

The JSON representation of the parameters passed to the LLM

LLM_TOKEN_COUNT_COMPLETION"llm.token_count.completion"

Token count for the completion by the llm (in tokens)

LLM_TOKEN_COUNT_COMPLETION_DETAILS"llm.token_count.completion_details"

Key prefix for additional completion token count details. Each detail should be a separate attribute with this prefix, e.g. llm.token_count.completion_details.reasoning, llm.token_count.completion_details.audio. All values should be in tokens (integer count of tokens).

LLM_TOKEN_COUNT_COMPLETION_DETAILS_REASONING"llm.token_count.completion_details.reasoning"

Token count for the reasoning steps in the completion (in tokens)

LLM_TOKEN_COUNT_COMPLETION_DETAILS_AUDIO"llm.token_count.completion_details.audio"

Token count for audio input generated by the model (in tokens)

LLM_TOKEN_COUNT_PROMPT"llm.token_count.prompt"

Token count for the prompt to the llm (in tokens)

LLM_TOKEN_COUNT_PROMPT_DETAILS"llm.token_count.prompt_details"

Key prefix for additional prompt token count details. Each detail should be a separate attribute with this prefix, e.g. llm.token_count.prompt_details.reasoning, llm.token_count.prompt_details.audio. All values should be in tokens (integer count of tokens).

LLM_TOKEN_COUNT_PROMPT_DETAILS_CACHE_WRITE"llm.token_count.prompt_details.cache_write"

Token count for the tokens written to cache (in tokens)

LLM_TOKEN_COUNT_PROMPT_DETAILS_CACHE_READ"llm.token_count.prompt_details.cache_read"

Token count for the tokens retrieved from cache (in tokens)

LLM_TOKEN_COUNT_PROMPT_DETAILS_CACHE_INPUT"llm.token_count.prompt_details.cache_input"

Token count for the input tokens in the prompt that were cached (in tokens)

LLM_TOKEN_COUNT_PROMPT_DETAILS_AUDIO"llm.token_count.prompt_details.audio"

Token count for audio input presented in the prompt (in tokens)

LLM_TOKEN_COUNT_TOTAL"llm.token_count.total"

Token count for the entire transaction with the llm (in tokens)

LLM_SYSTEM"llm.system"

The AI product as identified by the client or server

LLM_PROVIDER"llm.provider"

The provider of the inferences. E.g. the cloud provider

DECISION_MODEL_NAME"decision.model_name"

The name of the decision model. Mirrors LLM_MODEL_NAME for DECISION spans. A decision model takes state plus typed questions and returns a typed, probabilistic answer per question instead of generated text.

DECISION_REQUEST_MODEL_NAME"decision.request.model_name"

The decision model requested by the caller, as sent in the request. May differ from decision.response.model_name when the provider resolves an alias (e.g. jev-latest) or routes the request to a different model.

DECISION_RESPONSE_MODEL_NAME"decision.response.model_name"

The decision model that actually produced the response, as reported by the provider. May differ from decision.request.model_name.

DECISION_SYSTEM"decision.system"

The decision API ecosystem the call conforms to, i.e. which request and response shape the client speaks, as identified by the client or server: “typesafe” for the TypeSafe System One / Jev API, “openai” for the OpenAI Decisions API. A self-hosted vLLM server answering the Jev-compatible /v1/systemone shape is still “typesafe”. Distinct from DECISION_PROVIDER, which says who hosts the model. Well-known values are DecisionSystem, which alias the matching LLMSystem values.

DECISION_PROVIDER"decision.provider"

The hosting provider of the decision model: who runs the hardware that answered (e.g. “typesafe” when calling TypeSafe directly, or the cloud or self-hosting provider for a model served elsewhere). Distinct from DECISION_SYSTEM, which names the API shape. Well-known values are DecisionProvider, which alias the matching LLMProvider values.

DECISION_TOKEN_COUNT_INPUT"decision.token_count.input"

The number of input tokens consumed by a decision model call: the state, questions, and candidate options. Maps to usage.input_tokens in TypeSafe System One responses.

DECISION_TOKEN_COUNT_OUTPUT"decision.token_count.output"

The number of output tokens produced by a decision model call. Decision models emit typed answers rather than text, so this is typically small. Maps to usage.output_tokens in TypeSafe System One responses.

LLM_TOOLS"llm.tools"

List of tools that are advertised to the LLM to be able to call

LLM_FINISH_REASON"llm.finish_reason"

The reason the model stopped generating tokens, e.g. "stop" or "length".

LLM_COST"llm.cost"

Key prefix for cost information. When these keys are transformed into a JSON-like structure, it would look like: { “prompt”: 0.0021, # Cost in USD “completion”: 0.0045, # Cost in USD “total”: 0.0066, # Cost in USD “completion_details”: { “output”: 0.0009, # Cost in USD “reasoning”: 0.0024, # Cost in USD (e.g., 80 tokens * $0.03/1K tokens) “audio”: 0.0012 # Cost in USD (e.g., 40 tokens * $0.03/1K tokens) }, “prompt_details”: { “input”: 0.0003, # Cost in USD “cache_write”: 0.0006, # Cost in USD (e.g., 20 tokens * $0.03/1K tokens) “cache_read”: 0.0003, # Cost in USD (e.g., 10 tokens * $0.03/1K tokens) “cache_input”: 0.0006, # Cost in USD (e.g., 20 tokens * $0.03/1K tokens) “audio”: 0.0003 # Cost in USD (e.g., 10 tokens * $0.03/1K tokens) } } Note: This is a key prefix - individual attributes are stored as separate span attributes with this prefix, e.g. llm.cost.prompt, llm.cost.completion_details.reasoning, etc. The JSON structure shown above represents how these separate attributes can be conceptually organized. All monetary values are in USD with floating point precision.

LLM_COST_PROMPT"llm.cost.prompt"

Cost of the prompt tokens in USD

LLM_COST_COMPLETION"llm.cost.completion"

Cost of the completion tokens in USD

LLM_COST_TOTAL"llm.cost.total"

Total cost of the LLM call in USD (prompt + completion)

LLM_COST_INPUT"llm.cost.prompt_details.input"

Total cost of input tokens in USD. This represents the cost of tokens that were used as input to the model, which may be different from the prompt cost if there are additional processing steps.

LLM_COST_OUTPUT"llm.cost.completion_details.output"

Total cost of output tokens in USD. This represents the cost of tokens that were generated as output by the model, which may be different from the completion cost if there are additional processing steps.

LLM_COST_COMPLETION_DETAILS_REASONING"llm.cost.completion_details.reasoning"

Cost of reasoning steps in the completion in USD

LLM_COST_COMPLETION_DETAILS_AUDIO"llm.cost.completion_details.audio"

Cost of audio tokens in the completion in USD

LLM_COST_PROMPT_DETAILS_CACHE_WRITE"llm.cost.prompt_details.cache_write"

Cost of prompt tokens written to cache in USD

LLM_COST_PROMPT_DETAILS_CACHE_READ"llm.cost.prompt_details.cache_read"

Cost of prompt tokens read from cache in USD

LLM_COST_PROMPT_DETAILS_CACHE_INPUT"llm.cost.prompt_details.cache_input"

Cost of input tokens in the prompt that were cached in USD

LLM_COST_PROMPT_DETAILS_AUDIO"llm.cost.prompt_details.audio"

Cost of audio tokens in the prompt in USD

MESSAGE_ROLE"message.role"

The role that the LLM assumes the message is from during the LLM invocation

MESSAGE_NAME"message.name"

The name of the message. This is only used for role ‘function’ where the name of the function is captured in the name field and the parameters are captured in the content.

MESSAGE_TOOL_CALLS"message.tool_calls"

The tool calls generated by the model, such as function calls.

MESSAGE_TOOL_CALL_ID"message.tool_call_id"

The id of the tool call on a “tool” role message

TOOL_CALL_ID"tool_call.id"

The id of the tool call

TOOL_CALL_REASONING_SIGNATURE"tool_call.reasoning_signature"

Opaque vendor-issued reasoning echo token attached to a tool call. Maps to Gemini thoughtSignature when it is attached to a functionCall part

TOOL_CALL_FUNCTION_NAME"tool_call.function.name"

tool_call.function.name

TOOL_CALL_FUNCTION_ARGUMENTS_JSON"tool_call.function.arguments"

tool_call.function.argument (JSON string)

MESSAGE_FUNCTION_CALL_NAME"message.function_call_name"

The LLM function call function name

MESSAGE_FUNCTION_CALL_ARGUMENTS_JSON"message.function_call_arguments_json"

The LLM function call function arguments in a json string

MESSAGE_CONTENT"message.content"

The content of the message sent to the LLM

MESSAGE_CONTENTS"message.contents"

The array of contents for the message sent to the LLM. Each element of the array is an message_content object.

MESSAGE_CONTENT_IMAGE"message_content.image"

The image content of the message sent to the LLM

MESSAGE_CONTENT_AUDIO"message_content.audio"

The audio content of the message sent to the LLM

MESSAGE_CONTENT_VIDEO"message_content.video"

The video content of the message sent to the LLM

MESSAGE_CONTENT_DOCUMENT"message_content.document"

The document content (e.g. a PDF, an uploaded file, or inline text) of the message sent to the LLM

MESSAGE_CONTENT_ID"message_content.id"

Provider-assigned identifier for this message content item. For OpenAI Responses reasoning items, this maps to ResponseReasoningItem.id and should be preserved for stateless replay

MESSAGE_CONTENT_SIGNATURE"message_content.signature"

Opaque vendor-issued signature captured verbatim. Maps to provider signature fields and to Gemini thoughtSignature fields when the signature is attached to a non-tool content part

MESSAGE_CONTENT_DATA"message_content.data"

Opaque vendor-issued data captured verbatim. Maps to Anthropic redacted_thinking.data

MESSAGE_CONTENT_ENCRYPTED_CONTENT"message_content.encrypted_content"

OpenAI encrypted_content captured verbatim

MESSAGE_CONTENT_TEXT"message_content.text"

The text content of the message sent to the LLM

MESSAGE_CONTENT_TYPE"message_content.type"

The type of content sent to the LLM, such as “text”, “image”, “audio”, “video”, “document”, “reasoning”, or “tool_use”

DOCUMENT_ID"document.id"
DOCUMENT_CONTENT"document.content"
DOCUMENT_SCORE"document.score"
DOCUMENT_METADATA"document.metadata"
DOCUMENT_URL"document.url"

The URL, object-store URI, or base64 data URI of a file document such as a PDF.

DOCUMENT_MIME_TYPE"document.mime_type"

The MIME type of a document, for example application/pdf.

DOCUMENT_NAME"document.name"

The name supplied with a document, such as a file name or a title, for example invoice.pdf. Not a unique identifier.

EMBEDDING_EMBEDDINGS"embedding.embeddings"

The embedding list root

EMBEDDING_TEXT"embedding.text"

The text that was embedded to create the vector

EMBEDDING_MODEL_NAME"embedding.model_name"

The name of the model that was used to create the vector

EMBEDDING_VECTOR"embedding.vector"

The embedding vector. Typically a high dimensional vector of floats or ints

TOOL_DESCRIPTION"tool.description"

The description of a tool

TOOL_NAME"tool.name"

The name of a tool

TOOL_PARAMETERS"tool.parameters"

The parameters of the tool represented as a JSON string

TOOL_JSON_SCHEMA"tool.json_schema"

The json schema of a tool input, It is RECOMMENDED that this be in the OpenAI tool calling format: https://platform.openai.com/docs/assistants/tools

TOOL_ID"tool.id"

The identifier for the result of the tool call (corresponding to tool_call.id).

PROMPT_TEMPLATE_VARIABLES"llm.prompt_template.variables"

The JSON representation of the variables used in the prompt template

PROMPT_TEMPLATE_TEMPLATE"llm.prompt_template.template"

A prompt template

PROMPT_TEMPLATE_VERSION"llm.prompt_template.version"

A prompt template version

RERANKER_INPUT_DOCUMENTS"reranker.input_documents"

The documents used as input to the reranker

RERANKER_OUTPUT_DOCUMENTS"reranker.output_documents"

The documents output by the reranker

RERANKER_QUERY"reranker.query"

The query string for the reranker

RERANKER_MODEL_NAME"reranker.model_name"

The model name for the reranker

RERANKER_TOP_K"reranker.top_k"

The top k parameter for the reranker

LLM_FUNCTION_CALL"llm.function_call"

The JSON representation of a function call of an LLM

RETRIEVAL_DOCUMENTS"retrieval.documents"

The retrieval documents list root

SESSION_ID"session.id"

The session id of a trace. Used to correlate spans in a single session.

USER_ID"user.id"

The user id of a trace. Used to correlate spans for a single user.

METADATA"metadata"

Metadata for a span, used to store user-defined key-value pairs

TAG_TAGS"tag.tags"

The tags associated with a span

readonly OPENINFERENCE_SPAN_KIND"openinference.span.kind" = ...
PROMPT_VENDOR"prompt.vendor"

The vendor or origin of the prompt, e.g. a prompt library, a specialized service, etc.

PROMPT_ID"prompt.id"

A vendor-specific id used to locate the prompt

PROMPT_URL"prompt.url"

A vendor-specific URL used to locate the prompt

AGENT_NAME"agent.name"

The name of the agent. Agents that perform the same functions should have the same name.

GRAPH_NODE_ID"graph.node.id"

The id of the node in the execution graph. This along with graph.node.parent_id are used to visualize the execution graph.

GRAPH_NODE_NAME"graph.node.name"

The name of the node in the execution graph. Use this to present a human readable name for the node. Optional

GRAPH_NODE_PARENT_ID"graph.node.parent_id"

This references the id of the parent node. Leaving this unset or set as empty string implies that the current span is the root node.

AnnotatorKind

enumSource ↗
enum AnnotatorKind

Members

NameValue
HUMAN"HUMAN"
LLM"LLM"
CODE"CODE"

OpenInferenceSpanKind

enumSource ↗
enum OpenInferenceSpanKind

Members

NameValue
LLM"LLM"
CHAIN"CHAIN"
TOOL"TOOL"
RETRIEVER"RETRIEVER"
RERANKER"RERANKER"
EMBEDDING"EMBEDDING"
AGENT"AGENT"
GUARDRAIL"GUARDRAIL"
EVALUATOR"EVALUATOR"
PROMPT"PROMPT"
DECISION"DECISION"

MimeType

enumSource ↗
enum MimeType

An enum of common mime types. Not exhaustive.

Members

NameValue
TEXT"text/plain"
JSON"application/json"
AUDIO_WAV"audio/wav"

LLMSystem

enumSource ↗
enum LLMSystem

Members

NameValue
OPENAI"openai"
ANTHROPIC"anthropic"
MISTRALAI"mistralai"
COHERE"cohere"
VERTEXAI"vertexai"
AI21"ai21"
META"meta"
AMAZON"amazon"
TYPESAFE"typesafe"

LLMProvider

enumSource ↗
enum LLMProvider

Members

NameValue
OPENAI"openai"
ANTHROPIC"anthropic"
MISTRALAI"mistralai"
COHERE"cohere"
GOOGLE"google"
AWS"aws"
AZURE"azure"
XAI"xai"
DEEPSEEK"deepseek"
GROQ"groq"
FIREWORKS"fireworks"
MOONSHOT"moonshot"
CEREBRAS"cerebras"
PERPLEXITY"perplexity"
TOGETHER"together"
OLLAMA"ollama"
META"meta"
ZAI"zai"
MINIMAX"minimax"
TYPESAFE"typesafe"
ORACLE"oracle"
IBM"ibm"
DOUBLEWORD"doubleword"

DecisionSystem

enumSource ↗
enum DecisionSystem

Well-known values for decision.system: the decision API ecosystem a DECISION span conforms to. Each member aliases the LLMSystem member for the same vendor, so the same string names the same vendor on LLM and DECISION spans. The list is the subset of vendors currently known to offer a decision API.

Members

NameValue
TYPESAFE"typesafe"

TypeSafe AI System One / Jev API, including Jev-compatible servers.

OPENAI"openai"

OpenAI Decisions API.

DecisionProvider

enumSource ↗
enum DecisionProvider

Well-known values for decision.provider: who hosts the decision model that answered. Each member aliases the LLMProvider member for the same vendor.

Members

NameValue
TYPESAFE"typesafe"
OPENAI"openai"

Constants

NameValue
SEMRESATTRS_PROJECT_NAME"openinference.project.name" = PROJECT_NAME

The project name to group traces under for openinference compatible services

ANNOTATIONS"annotations" = SemanticAttributePrefixes.annotations
EVALUATIONS"evaluations" = SemanticAttributePrefixes.evaluations
TRACE_ANNOTATIONS"trace.annotations"
TRACE_EVALUATIONS"trace.evaluations"
SESSION_ANNOTATIONS"session.annotations"
SESSION_EVALUATIONS"session.evaluations"
ANNOTATION_NAME"annotation.name"
ANNOTATION_SCORE"annotation.score"
ANNOTATION_LABEL"annotation.label"
ANNOTATION_EXPLANATION"annotation.explanation"
ANNOTATION_ANNOTATOR_KIND"annotation.annotator_kind"
ANNOTATION_IDENTIFIER"annotation.identifier"
ANNOTATION_METADATA"annotation.metadata"
EVALUATION_NAME"evaluation.name"
EVALUATION_SCORE"evaluation.score"
EVALUATION_LABEL"evaluation.label"
EVALUATION_EXPLANATION"evaluation.explanation"
EVALUATION_ANNOTATOR_KIND"evaluation.annotator_kind"
EVALUATION_IDENTIFIER"evaluation.identifier"
EVALUATION_METADATA"evaluation.metadata"
INPUT_VALUE"input.value"

The input to any span

INPUT_MIME_TYPE"input.mime_type"
INPUT_IMAGES"input.images"

Images passed as input to a span of any kind. Flattened with an index, for example input.images.0.image.url.

INPUT_DOCUMENTS"input.documents"

Documents (e.g. PDFs) passed as input to a span of any kind. Flattened with an index, for example input.documents.0.document.url.

OUTPUT_VALUE"output.value"

The output of any span

OUTPUT_MIME_TYPE"output.mime_type"
OUTPUT_IMAGES"output.images"

Images produced as output by a span of any kind. Flattened with an index, for example output.images.0.image.url.

OUTPUT_DOCUMENTS"output.documents"

Documents (e.g. PDFs) produced as output by a span of any kind. Flattened with an index, for example output.documents.0.document.url.

LLM_INPUT_MESSAGES"llm.input_messages"

The messages sent to the LLM for completions Typically seen in OpenAI chat completions

LLM_PROMPTS"llm.prompts"

The prompts sent to the LLM for completions Typically seen in OpenAI legacy completions

LLM_INVOCATION_PARAMETERS"llm.invocation_parameters"

The JSON representation of the parameters passed to the LLM

LLM_OUTPUT_MESSAGES"llm.output_messages"

The messages received from the LLM for completions Typically seen in OpenAI chat completions

LLM_MODEL_NAME"llm.model_name"

The name of the LLM model

LLM_REQUEST_MODEL_NAME"llm.request.model_name"

The model requested by the caller, as sent in the request. May differ from llm.response.model_name when the provider routes the request to a different model (e.g. classifier-triggered fallback).

LLM_RESPONSE_MODEL_NAME"llm.response.model_name"

The model that actually generated the response, as reported by the provider. May differ from llm.request.model_name when the provider routes the request to a different model (e.g. classifier-triggered fallback).

LLM_PROVIDER"llm.provider"

The provider of the inferences. E.g. the cloud provider

LLM_SYSTEM"llm.system"

The AI product as identified by the client or server

DECISION_MODEL_NAME"decision.model_name"

The name of the decision model. Mirrors LLM_MODEL_NAME for DECISION spans. A decision model takes state plus typed questions and returns a typed, probabilistic answer per question instead of generated text.

DECISION_REQUEST_MODEL_NAME"decision.request.model_name"

The decision model requested by the caller, as sent in the request. May differ from decision.response.model_name when the provider resolves an alias (e.g. jev-latest) or routes the request to a different model.

DECISION_RESPONSE_MODEL_NAME"decision.response.model_name"

The decision model that actually produced the response, as reported by the provider. May differ from decision.request.model_name.

DECISION_PROVIDER"decision.provider"

The hosting provider of the decision model: who runs the hardware that answered (e.g. “typesafe” when calling TypeSafe directly, or the cloud or self-hosting provider for a model served elsewhere). Distinct from DECISION_SYSTEM, which names the API shape. Well-known values are DecisionProvider, which alias the matching LLMProvider values.

DECISION_SYSTEM"decision.system"

The decision API ecosystem the call conforms to, i.e. which request and response shape the client speaks, as identified by the client or server: “typesafe” for the TypeSafe System One / Jev API, “openai” for the OpenAI Decisions API. A self-hosted vLLM server answering the Jev-compatible /v1/systemone shape is still “typesafe”. Distinct from DECISION_PROVIDER, which says who hosts the model. Well-known values are DecisionSystem, which alias the matching LLMSystem values.

DECISION_TOKEN_COUNT_INPUT"decision.token_count.input"

The number of input tokens consumed by a decision model call: the state, questions, and candidate options. Maps to usage.input_tokens in TypeSafe System One responses.

DECISION_TOKEN_COUNT_OUTPUT"decision.token_count.output"

The number of output tokens produced by a decision model call. Decision models emit typed answers rather than text, so this is typically small. Maps to usage.output_tokens in TypeSafe System One responses.

LLM_TOKEN_COUNT_COMPLETION"llm.token_count.completion"

Token count for the completion by the llm (in tokens)

LLM_TOKEN_COUNT_COMPLETION_DETAILS_REASONING"llm.token_count.completion_details.reasoning"

Token count for the reasoning steps in the completion (in tokens)

LLM_TOKEN_COUNT_COMPLETION_DETAILS_AUDIO"llm.token_count.completion_details.audio"

Token count for audio input generated by the model (in tokens)

LLM_TOKEN_COUNT_PROMPT"llm.token_count.prompt"

Token count for the prompt to the llm (in tokens)

LLM_TOKEN_COUNT_PROMPT_DETAILS_CACHE_WRITE"llm.token_count.prompt_details.cache_write"

Token count for the tokens written to cache (in tokens)

LLM_TOKEN_COUNT_PROMPT_DETAILS_CACHE_READ"llm.token_count.prompt_details.cache_read"

Token count for the tokens retrieved from cache (in tokens)

LLM_TOKEN_COUNT_PROMPT_DETAILS_CACHE_INPUT"llm.token_count.prompt_details.cache_input"

Token count for the input tokens in the prompt that were cached (in tokens)

LLM_TOKEN_COUNT_PROMPT_DETAILS_AUDIO"llm.token_count.prompt_details.audio"

Token count for audio input presented in the prompt (in tokens)

LLM_TOKEN_COUNT_TOTAL"llm.token_count.total"

Token count for the entire transaction with the llm (in tokens)

LLM_FINISH_REASON"llm.finish_reason"

The reason the model stopped generating tokens, e.g. "stop" or "length".

LLM_TOKEN_COUNT_PROMPT_DETAILS"llm.token_count.prompt_details"

Key prefix for additional prompt token count details. Each detail should be a separate attribute with this prefix, e.g. llm.token_count.prompt_details.reasoning, llm.token_count.prompt_details.audio. All values should be in tokens (integer count of tokens).

LLM_TOKEN_COUNT_COMPLETION_DETAILS"llm.token_count.completion_details"

Key prefix for additional completion token count details. Each detail should be a separate attribute with this prefix, e.g. llm.token_count.completion_details.reasoning, llm.token_count.completion_details.audio. All values should be in tokens (integer count of tokens).

LLM_COST"llm.cost"

Key prefix for cost information. When these keys are transformed into a JSON-like structure, it would look like: { “prompt”: 0.0021, # Cost in USD “completion”: 0.0045, # Cost in USD “total”: 0.0066, # Cost in USD “completion_details”: { “output”: 0.0009, # Cost in USD “reasoning”: 0.0024, # Cost in USD (e.g., 80 tokens * $0.03/1K tokens) “audio”: 0.0012 # Cost in USD (e.g., 40 tokens * $0.03/1K tokens) }, “prompt_details”: { “input”: 0.0003, # Cost in USD “cache_write”: 0.0006, # Cost in USD (e.g., 20 tokens * $0.03/1K tokens) “cache_read”: 0.0003, # Cost in USD (e.g., 10 tokens * $0.03/1K tokens) “cache_input”: 0.0006, # Cost in USD (e.g., 20 tokens * $0.03/1K tokens) “audio”: 0.0003 # Cost in USD (e.g., 10 tokens * $0.03/1K tokens) } } Note: This is a key prefix - individual attributes are stored as separate span attributes with this prefix, e.g. llm.cost.prompt, llm.cost.completion_details.reasoning, etc. The JSON structure shown above represents how these separate attributes can be conceptually organized. All monetary values are in USD with floating point precision.

LLM_COST_PROMPT"llm.cost.prompt"

Cost of the prompt tokens in USD

LLM_COST_COMPLETION"llm.cost.completion"

Cost of the completion tokens in USD

LLM_COST_TOTAL"llm.cost.total"

Total cost of the LLM call in USD (prompt + completion)

LLM_COST_INPUT"llm.cost.prompt_details.input"

Total cost of input tokens in USD. This represents the cost of tokens that were used as input to the model, which may be different from the prompt cost if there are additional processing steps.

LLM_COST_OUTPUT"llm.cost.completion_details.output"

Total cost of output tokens in USD. This represents the cost of tokens that were generated as output by the model, which may be different from the completion cost if there are additional processing steps.

LLM_COST_COMPLETION_DETAILS_REASONING"llm.cost.completion_details.reasoning"

Cost of reasoning steps in the completion in USD

LLM_COST_COMPLETION_DETAILS_AUDIO"llm.cost.completion_details.audio"

Cost of audio tokens in the completion in USD

LLM_COST_PROMPT_DETAILS_CACHE_WRITE"llm.cost.prompt_details.cache_write"

Cost of prompt tokens written to cache in USD

LLM_COST_PROMPT_DETAILS_CACHE_READ"llm.cost.prompt_details.cache_read"

Cost of prompt tokens read from cache in USD

LLM_COST_PROMPT_DETAILS_CACHE_INPUT"llm.cost.prompt_details.cache_input"

Cost of input tokens in the prompt that were cached in USD

LLM_COST_PROMPT_DETAILS_AUDIO"llm.cost.prompt_details.audio"

Cost of audio tokens in the prompt in USD

MESSAGE_ROLE"message.role"

The role that the LLM assumes the message is from during the LLM invocation

MESSAGE_NAME"message.name"

The name of the message. This is only used for role ‘function’ where the name of the function is captured in the name field and the parameters are captured in the content.

MESSAGE_TOOL_CALLS"message.tool_calls"

The tool calls generated by the model, such as function calls.

MESSAGE_TOOL_CALL_ID"message.tool_call_id"

The id of the tool call on a “tool” role message

TOOL_CALL_FUNCTION_NAME"tool_call.function.name"

tool_call.function.name

TOOL_CALL_FUNCTION_ARGUMENTS_JSON"tool_call.function.arguments"

tool_call.function.argument (JSON string)

TOOL_CALL_ID"tool_call.id"

The id of the tool call

TOOL_CALL_REASONING_SIGNATURE"tool_call.reasoning_signature"

Opaque vendor-issued reasoning echo token attached to a tool call. Maps to Gemini thoughtSignature when it is attached to a functionCall part

MESSAGE_FUNCTION_CALL_NAME"message.function_call_name"

The LLM function call function name

MESSAGE_FUNCTION_CALL_ARGUMENTS_JSON"message.function_call_arguments_json"

The LLM function call function arguments in a json string

MESSAGE_CONTENT"message.content"

The content of the message sent to the LLM

MESSAGE_CONTENTS"message.contents"

The array of contents for the message sent to the LLM. Each element of the array is an message_content object.

MESSAGE_CONTENT_TYPE"message_content.type"

The type of content sent to the LLM, such as “text”, “image”, “audio”, “video”, “document”, “reasoning”, or “tool_use”

MESSAGE_CONTENT_TEXT"message_content.text"

The text content of the message sent to the LLM

MESSAGE_CONTENT_IMAGE"message_content.image"

The image content of the message sent to the LLM

MESSAGE_CONTENT_AUDIO"message_content.audio"

The audio content of the message sent to the LLM

MESSAGE_CONTENT_VIDEO"message_content.video"

The video content of the message sent to the LLM

MESSAGE_CONTENT_DOCUMENT"message_content.document"

The document content (e.g. a PDF, an uploaded file, or inline text) of the message sent to the LLM

MESSAGE_CONTENT_ID"message_content.id"

Provider-assigned identifier for this message content item. For OpenAI Responses reasoning items, this maps to ResponseReasoningItem.id and should be preserved for stateless replay

MESSAGE_CONTENT_SIGNATURE"message_content.signature"

Opaque vendor-issued signature captured verbatim. Maps to provider signature fields and to Gemini thoughtSignature fields when the signature is attached to a non-tool content part

MESSAGE_CONTENT_DATA"message_content.data"

Opaque vendor-issued data captured verbatim. Maps to Anthropic redacted_thinking.data

MESSAGE_CONTENT_ENCRYPTED_CONTENT"message_content.encrypted_content"

OpenAI encrypted_content captured verbatim

IMAGE_URL"image.url"

The http or base64 link to the image

VIDEO_URL"video.url"

The URL, object-store URI, or base64 data URI of a video.

DOCUMENT_ID"document.id"
DOCUMENT_CONTENT"document.content"
DOCUMENT_SCORE"document.score"
DOCUMENT_METADATA"document.metadata"
DOCUMENT_URL"document.url"

The URL, object-store URI, or base64 data URI of a file document such as a PDF.

DOCUMENT_MIME_TYPE"document.mime_type"

The MIME type of a document, for example application/pdf.

DOCUMENT_NAME"document.name"

The name supplied with a document, such as a file name or a title, for example invoice.pdf. Not a unique identifier.

EMBEDDING_TEXT"embedding.text"

The text that was embedded to create the vector

EMBEDDING_MODEL_NAME"embedding.model_name"

The name of the model that was used to create the vector

EMBEDDING_VECTOR"embedding.vector"

The embedding vector. Typically a high dimensional vector of floats or ints

EMBEDDING_EMBEDDINGS"embedding.embeddings"

The embedding list root

RETRIEVAL_DOCUMENTS"retrieval.documents"

The retrieval documents list root

PROMPT_TEMPLATE_VARIABLES"llm.prompt_template.variables"

The JSON representation of the variables used in the prompt template

PROMPT_TEMPLATE_TEMPLATE"llm.prompt_template.template"

A prompt template

LLM_FUNCTION_CALL"llm.function_call"

The JSON representation of a function call of an LLM

LLM_TOOLS"llm.tools"

List of tools that are advertised to the LLM to be able to call

TOOL_NAME"tool.name"

The name of a tool

TOOL_DESCRIPTION"tool.description"

The description of a tool

TOOL_PARAMETERS"tool.parameters"

The parameters of the tool represented as a JSON string

TOOL_JSON_SCHEMA"tool.json_schema"

The json schema of a tool input, It is RECOMMENDED that this be in the OpenAI tool calling format: https://platform.openai.com/docs/assistants/tools

TOOL_ID"tool.id"

The identifier for the result of the tool call (corresponding to tool_call.id).

SESSION_ID"session.id"

The session id of a trace. Used to correlate spans in a single session.

USER_ID"user.id"

The user id of a trace. Used to correlate spans for a single user.

RERANKER_INPUT_DOCUMENTS"reranker.input_documents"

The documents used as input to the reranker

RERANKER_OUTPUT_DOCUMENTS"reranker.output_documents"

The documents output by the reranker

RERANKER_QUERY"reranker.query"

The query string for the reranker

RERANKER_MODEL_NAME"reranker.model_name"

The model name for the reranker

RERANKER_TOP_K"reranker.top_k"

The top k parameter for the reranker

METADATA"metadata"

Metadata for a span, used to store user-defined key-value pairs

PROMPT_TEMPLATE_VERSION"llm.prompt_template.version"

A prompt template version

TAG_TAGS"tag.tags"

The tags associated with a span

AUDIO_URL"audio.url"

The url of an audio file

AUDIO_MIME_TYPE"audio.mime_type"

The audio mime type

AUDIO_TRANSCRIPT"audio.transcript"

The audio transcript as text

PROMPT_VENDOR"prompt.vendor"

The vendor or origin of the prompt, e.g. a prompt library, a specialized service, etc.

PROMPT_ID"prompt.id"

A vendor-specific id used to locate the prompt

PROMPT_URL"prompt.url"

A vendor-specific URL used to locate the prompt

AGENT_NAME"agent.name"

The name of the agent. Agents that perform the same functions should have the same name.

GRAPH_NODE_ID"graph.node.id"

The id of the node in the execution graph. This along with graph.node.parent_id are used to visualize the execution graph.

GRAPH_NODE_NAME"graph.node.name"

The name of the node in the execution graph. Use this to present a human readable name for the node. Optional

GRAPH_NODE_PARENT_ID"graph.node.parent_id"

This references the id of the parent node. Leaving this unset or set as empty string implies that the current span is the root node.