Skip to main content

Base URL

Create Session

name
string
required
Descriptive name for the session.
agentName
string
required
Agent identifier for grouping.
userId
string
required
External user identifier.
metadata
object
Custom key-value data.

Request

Response

cURL Example

Update Session

status
string
"completed" or "failed".
success
boolean
Whether session completed successfully.
failureReason
string
Reason for failure if success=false.
estimatedCost
number
Total cost in USD.
durationMs
number
Duration in milliseconds.
promptTokens
number
Input tokens used.
completionTokens
number
Output tokens used.
totalTokens
number
Total tokens.
customMetrics
object
Custom numeric metrics.

Request

Response

cURL Example

Error Codes

Next Steps

Events API

Track events within sessions.

Python SDK

Use the SDK for easier integration.