POST
/
v1
/
agents
/
{agent_id}
/
messages

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

agent_id
string
required

Body

application/json
messages
object[]
required

The messages to be sent to the agent.

run_async
boolean
default: false

Whether to asynchronously send the messages to the agent.

stream_steps
boolean
default: false

Flag to determine if the response should be streamed. Set to True for streaming agent steps.

stream_tokens
boolean
default: false

Flag to determine if individual tokens should be streamed. Set to True for token streaming (requires stream_steps = True).

return_message_object
boolean
default: false

Set True to return the raw Message object. Set False to return the Message in the format of the Letta API.

Response

200 - application/json
messages
required

The messages returned by the agent.

usage
object
required

The usage statistics of the agent.