Skip to main content
POST
Python

Authorizations

X-Auth-Token
string
header
required

Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.

Path Parameters

id
string
required

The connected agent id.

Minimum string length: 1

Body

application/json
messages
object[]
required

The whole conversation so far, OpenAI style.

newMessages
object[]

The messages added since the agent's last turn. Defaults to the last message.

threadId
string

The conversation id. Turns of one conversation share it; a new id starts a new one.

Maximum string length: 255
params
object

Run parameter values by name, as JSON scalars.

session
any

The session the agent returned on its previous turn of this conversation, echoed back as is.

traceparent
string

The W3C trace context the agent adopts, so its spans join this turn's trace.

Maximum string length: 255
run
object

The simulation run this turn belongs to, if any.

Response

Success

output
required

What the function answered: text, one message, or a list of messages.

instance
object
required
durationMs
number
required
session
any

The agent's per-conversation memory, to send on the next turn.

Last modified on August 31, 2026