{"messages": [{"role": "user", "content": "..."}]}; other span kinds can carry domain-specific values.
Token usage records prompt/completion/total tokens and may include provider-specific numeric usage. Cost is a dictionary of monetary amounts; the SDK does not calculate missing provider prices.
Construct SpanData, TraceData, and ScoreData with their init objects; toApiDict() performs wire serialization. The init interfaces shown below describe accepted objects but are not independently exported at the package root.
On this page
ScoreData, ScoreDataInit, ScoreDataType, SpanData, SpanDataInit, SpanKind, SpanStatusCode, TraceData, TraceDataInit, TraceStatus.Example
ScoreData
Constructor
Fields and properties
Methods
toApiDict
toApiDict
ScoreDataInit
Supporting contract used by the API below; it is not a separate package export.
Source declaration
Fields and properties
ScoreDataType
Values
SpanData
Constructor
Fields and properties
Methods
toApiDict
toApiDict
Serialize to a dict matching the backend POST /traces span schema.
SpanDataInit
Supporting contract used by the API below; it is not a separate package export.
Source declaration
Fields and properties
SpanKind
Values
SpanStatusCode
Values
TraceData
Constructor
Fields and properties
Methods
toApiDict
toApiDict
Serialize to a dict matching the backend POST /traces schema.
TraceDataInit
Supporting contract used by the API below; it is not a separate package export.
Source declaration
Fields and properties
TraceStatus
Values
Signatures and fields are generated from the SDK source. See the import index for available entry points.

