Ingest spans from traces

Ingest an array of spans as a trace. Each span uses the same fields as Create span, plus span_unique_id to identify each span within the trace.

Headers

AuthorizationstringRequired

Bearer token. Use Bearer YOUR_API_KEY.

Request

This endpoint expects a list of objects.
trace_unique_idstringRequired
Trace ID linking all spans in this trace.
span_unique_idstringRequired
Unique span ID within the trace.
idstringOptional
Unique ID for this span.
span_parent_idstring or nullOptional

Parent span ID. null for root spans.

span_namestringOptional
Name of this span.
span_workflow_namestringOptional
Name of the parent workflow.
log_typeenumOptionalDefaults to chat
Type of span.
inputanyOptional

The input to the model. Format depends on log_type.

outputanyOptional

The output from the model. Format depends on log_type.

modelstringOptional
Model used.
usageobjectOptional
Token usage.
costdoubleOptional
Cost in USD.
latencydoubleOptional
Latency in seconds.
statusenumOptional
Request status.
Allowed values:
timestampdatetimeOptional

When the request completed (ISO 8601).

start_timedatetimeOptional

When the request started (ISO 8601).

customer_identifierstringOptional
End user identifier.
metadataobjectOptional

Arbitrary key-value pairs.

Response

Successful response for Ingest spans from traces

Errors

401
Unauthorized Error