Send Message Async

Asynchronously process a user message and return a run object. The actual processing happens in the background, and the status can be checked using the run ID. This is "asynchronous" in the sense that it's a background run and explicitly must be fetched by the run ID.

Authentication

AuthorizationBearer

Header authentication of the form Bearer <token>

Path parameters

agent_idstringRequiredformat: "^agent-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"=42 characters

The ID of the agent in the format ‘agent-<uuid4>’

Request

This endpoint expects an object.
messageslist of objectsRequired
The messages to be sent to the agent.
max_stepsintegerOptionalDefaults to 50
Maximum number of steps the agent should take to process the request.
use_assistant_messagebooleanOptionalDefaults to true

Whether the server should parse specific tool call arguments (default send_message) as AssistantMessage objects.

assistant_message_tool_namestringOptionalDefaults to send_message
The name of the designated message tool.
assistant_message_tool_kwargstringOptionalDefaults to message
The name of the message argument in the designated message tool.
include_return_message_typeslist of enums or nullOptional

Only return specified message types in the response. If None (default) returns all messages.

enable_thinkingstringOptional
If set to True, enables reasoning before responses or tool calls from the agent.
callback_urlstring or nullOptional
Optional callback URL to POST to when the job completes

Response

Successful Response
agent_idstring
The unique identifier of the agent associated with the run.
idstring or nullformat: "^(job|run)-[a-fA-F0-9]{8}"

The human-friendly ID of the Run

statusenum or null
The current status of the run.
Allowed values:
created_atstring or nullformat: "date-time"
The timestamp when the run was created.
completed_atstring or nullformat: "date-time"
The timestamp when the run was completed.
backgroundboolean or null
Whether the run was created in background mode.
metadatamap from strings to any or null
Additional metadata for the run.
request_configobject or null
The request configuration for the run.
stop_reasonenum or null
The reason why the run was stopped.
callback_urlstring or null
If set, POST to this URL when the run completes.
callback_sent_atstring or nullformat: "date-time"
Timestamp when the callback was last attempted.
callback_status_codeinteger or null
HTTP status code returned by the callback endpoint.
callback_errorstring or null
Optional error message from attempting to POST the callback endpoint.
ttft_nsinteger or null
Time to first token for a run in nanoseconds
total_duration_nsinteger or null
Total run duration in nanoseconds

Errors