Skip to main content
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
}

Documentation Index

Fetch the complete documentation index at: https://playgent.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Update a span with its output, timing, and metrics after the operation completes.
span_id
string
required
Span identifier
output
object
required
Span output data
end_time
string
required
ISO 8601 timestamp when span completed
tokens_input
integer
Input tokens used (LLM spans)
tokens_output
integer
Output tokens generated (LLM spans)
cost_usd
number
Estimated cost in USD
status
string
required
Span status: completed or error
error_message
string
Error message if status is error
span_id
string
required
Updated span identifier
duration_ms
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
}