Traces
Ingest spans (legacy)
Changed onAccepts spans as a JSON array or an object whose data field contains the array. Each span uses the fields in Create a span, plus trace_unique_id, span_unique_id, and optional span_parent_id to build the trace tree. For new integrations, use Ingest traces (OTLP).
post/api/v1/traces/ingest
Request
- Base URLhttps://api.respan.ai
- URLhttps://api.respan.ai/api/v1/traces/ingest
- AuthHTTP bearer
Request body
Example request
[
{
"trace_unique_id": "trace_abc123",
"span_unique_id": "span_001",
"span_name": "llm_call",
"span_workflow_name": "support_flow",
"log_type": "chat",
"input": "[{\"role\": \"user\", \"content\": \"Hello\"}]",
"output": "{\"role\": \"assistant\", \"content\": \"Hi!\"}",
"model": "gpt-4o",
"usage": {
"prompt_tokens": 10,
"completion_tokens": 8,
"total_tokens": 18
},
"cost": 0.001,
"latency": 1.2,
"status": "success",
"timestamp": "2025-01-15T10:30:00Z",
"start_time": "2025-01-15T10:29:59Z",
"customer_identifier": "user_123",
"metadata": {
"env": "production"
},
"span_path": "joke_creation.store_joke",
"encoding_format": "float",
"provider_id": "openai",
"prompt_tokens": 150,
"completion_tokens": 80,
"temperature": 0.7,
"max_tokens": 1024
}
]Response
Trace spans processed successfully
Example response
{
"message": "Processed 2 Vercel spans"
}Changes
- breaking
request body became required
- breaking
removed from the request body
oneOflist - info
api operation id
traces_createTraceLegacyremoved and replaced withcreateTraceLegacy - info
api tag
Tracesadded - info
api tag
tracesremoved - info
added
subschema #1subschema #2to the request bodyoneOflist
- breaking
- info
added the non-success response with the status
- info
removed the non-success response with the status
- info