Skip to content

Create a new agent span

POST
/api/v1/agent_spans
AgentSpan_DetailsForCreate
object
agent_instance_id
required
AgentInstance_Id

A valid agent instance ID

string
Example
013xrzp12g3nqk8n4evtrcj59k8dhn3t
finished_at
One of:

When the span finished (ISO 8601 format). If not provided, span is still in progress.

string format: date-time
Example
2024-01-01T00:00:00Z
id
One of:
AgentSpan_Id

A valid agent span ID

string
Example
013xrzp12g3nqk8ndr93q068mw7y0nv0
parent_span_id
One of:
AgentSpan_Id

A valid agent span ID

string
Example
013xrzp12g3nqk8ndr93q068mw7y0nv0
payload
required

Span payload data (arbitrary JSON object)

object
key
additional properties
any
result_payload
One of:

Result payload (arbitrary JSON). Only valid when status is complete, failed, or cancelled.

object
key
additional properties
any
schema_name
required

Name of the schema for this span

string
Example
llm
started_at
One of:

When the span started (ISO 8601 format). If not provided, current time is used.

string format: date-time
Example
2024-01-01T00:00:00Z
status
required

Status of the span (required)

string
Allowed values: pending active complete failed cancelled
Example
active

Success

object
details
AgentSpan_Details
object
account_id
Account_Id

A valid account ID

string
Example
013xrzp12g3nqk8ngskn1wtxgka5b0nf
agent_id
Agent_Id

A valid agent ID

string
Example
013xrzp12g3nqk8nx0y2vfkg4s3jp2qr
agent_instance_id
AgentInstance_Id

A valid agent instance ID

string
Example
013xrzp12g3nqk8n4evtrcj59k8dhn3t
finished_at
One of:

When the span finished (null if still in progress)

string format: date-time
Example
2024-01-01T00:00:00Z
id
AgentSpan_Id

A valid agent span ID

string
Example
013xrzp12g3nqk8ndr93q068mw7y0nv0
parent_span_id
One of:
AgentSpan_Id

A valid agent span ID

string
Example
013xrzp12g3nqk8ndr93q068mw7y0nv0
payload

Span payload data (arbitrary JSON object)

object
key
additional properties
any
result_payload
One of:

Result payload (arbitrary JSON), only present when span is finished

object
key
additional properties
any
schema_name

Name of the schema for this span

string
Example
llm
schema_title

Human-readable title for the schema (from JSON schema, defaults to schema_name)

string
Example
LLM
started_at
One of:

When the span started (null when status is pending)

string format: date-time
Example
2024-01-01T00:00:00Z
status

Status of the span: ‘pending’ (not started), ‘active’ (started but not finished), ‘complete’ (finished successfully), ‘failed’ (ended with failure), or ‘cancelled’ (never started, cancelled)

string
Allowed values: pending active complete failed cancelled
Example
active
summary
One of:

Human-readable summary rendered from the schema template using payload and result_payload (null when template is missing)

string
type

Type of resource (always ‘agent_span’)

string
Allowed values: agent_span
Example
agent_span
status
string
Allowed values: success
Example
success

Error

One of:
object
code
string
Allowed values: bad_request bad_authtoken not_authenticated not_permitted not_implemented unknown not_found unexpected_ref_type unexpected invalid_action invalid_value required_value idempotency_key_already_used
Example
bad_request
message
string
status
string
Allowed values: error
Example
error