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
required

The messages to be sent to the agent.

assistant_message_tool_name
string
default: send_message

The name of the designated message tool.

assistant_message_tool_kwarg
string
default: message

The name of the message argument in the designated message tool.

Response

200 - application/json
AssistantMessage
object
FunctionCall
object
FunctionCallDelta
object
FunctionCallMessage
object

A message representing a request to call a function (generated by the LLM to trigger function execution).

Attributes: function_call (Union[FunctionCall, FunctionCallDelta]): The function call id (str): The ID of the message date (datetime): The date the message was created in ISO format

FunctionReturn
object

A message representing the return value of a function call (generated by Letta executing the requested function).

Attributes: function_return (str): The return value of the function status (Literal["success", "error"]): The status of the function call id (str): The ID of the message date (datetime): The date the message was created in ISO format function_call_id (str): A unique identifier for the function call that generated this message

InternalMonologue
object

Representation of an agent's internal monologue.

Attributes: internal_monologue (str): The internal monologue of the agent id (str): The ID of the message date (datetime): The date the message was created in ISO format

LettaUsageStatistics
object

Usage statistics for the agent interaction.

Attributes: completion_tokens (int): The number of tokens generated by the agent. prompt_tokens (int): The number of tokens in the prompt. total_tokens (int): The total number of tokens processed by the agent. step_count (int): The number of steps taken by the agent.

SystemMessage
object

A message generated by the system. Never streamed back on a response, only used for cursor pagination.

Attributes: message (str): The message sent by the system id (str): The ID of the message date (datetime): The date the message was created in ISO format

UserMessage
object

A message sent by the user. Never streamed back on a response, only used for cursor pagination.

Attributes: message (str): The message sent by the user id (str): The ID of the message date (datetime): The date the message was created in ISO format