curl -X POST https://api.playgent.com/v1/traces/trace_ghi789/spans \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"parent_span_id": "span_jkl012",
"name": "gpt-4-turbo call",
"kind": "llm",
"input": {
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "What is your refund policy?" }
],
"model": "gpt-4-turbo",
"temperature": 0.7
},
"start_time": "2024-12-16T10:00:00.123Z"
}'
{
"span_id": "span_mno345"
}
Tracing
Add Span
Add a span to an existing trace
POST
/
v1
/
traces
/
{trace_id}
/
spans
curl -X POST https://api.playgent.com/v1/traces/trace_ghi789/spans \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"parent_span_id": "span_jkl012",
"name": "gpt-4-turbo call",
"kind": "llm",
"input": {
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "What is your refund policy?" }
],
"model": "gpt-4-turbo",
"temperature": 0.7
},
"start_time": "2024-12-16T10:00:00.123Z"
}'
{
"span_id": "span_mno345"
}
Add a span to capture a specific operation during agent execution (LLM call, tool invocation, retrieval, etc.).
string
required
Parent trace identifier
string
Parent span ID for nested spans
string
required
Span name (e.g., “gpt-4-turbo call”, “vector_search”)
string
required
Span type:
llm, tool, retrieval, agent, chainobject
required
string
required
ISO 8601 timestamp when span started
string
required
Unique span identifier
curl -X POST https://api.playgent.com/v1/traces/trace_ghi789/spans \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"parent_span_id": "span_jkl012",
"name": "gpt-4-turbo call",
"kind": "llm",
"input": {
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "What is your refund policy?" }
],
"model": "gpt-4-turbo",
"temperature": 0.7
},
"start_time": "2024-12-16T10:00:00.123Z"
}'
{
"span_id": "span_mno345"
}

