curl -X PATCH https://api.playgent.com/v1/spans/span_mno345 \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"output": {
"content": "Our refund policy allows returns within 30 days...",
"tool_calls": []
},
"end_time": "2024-12-16T10:00:02.456Z",
"tokens_input": 234,
"tokens_output": 156,
"cost_usd": 0.0089,
"status": "completed"
}'
{
"span_id": "span_mno345",
"duration_ms": 2333
}
Tracing
Update Span
Complete a span with output and metrics
PATCH
/
v1
/
spans
/
{span_id}
curl -X PATCH https://api.playgent.com/v1/spans/span_mno345 \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"output": {
"content": "Our refund policy allows returns within 30 days...",
"tool_calls": []
},
"end_time": "2024-12-16T10:00:02.456Z",
"tokens_input": 234,
"tokens_output": 156,
"cost_usd": 0.0089,
"status": "completed"
}'
{
"span_id": "span_mno345",
"duration_ms": 2333
}
Update a span with its output, timing, and metrics after the operation completes.
string
required
Span identifier
object
required
string
required
ISO 8601 timestamp when span completed
integer
Input tokens used (LLM spans)
integer
Output tokens generated (LLM spans)
number
Estimated cost in USD
string
required
Span status:
completed or errorstring
Error message if status is
errorstring
required
Updated span identifier
integer
required
Calculated duration in milliseconds
curl -X PATCH https://api.playgent.com/v1/spans/span_mno345 \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"output": {
"content": "Our refund policy allows returns within 30 days...",
"tool_calls": []
},
"end_time": "2024-12-16T10:00:02.456Z",
"tokens_input": 234,
"tokens_output": 156,
"cost_usd": 0.0089,
"status": "completed"
}'
{
"span_id": "span_mno345",
"duration_ms": 2333
}

