Skip to main content
POST
Send messages
Sends one or more messages to a session: extra instructions, answers to the agent’s questions, or a new direction. The agent reads them on its next step. Delivery adapts to the session’s state: a paused session is resumed first, a queued session buffers the message until it starts, and a finished session restarts (back to pending, subject to your token budget) with the message delivered to the relaunched agent. Returns 202 Accepted. The message is delivered asynchronously.

Path parameters

string
required
The session ID.

Request body

Send either a single message or a batch, discriminated by type.

Single message

string
default:"user_message"
"user_message". May be omitted.
string
required
The message text.
string[]
Base64 data URIs to attach (e.g. data:image/png;base64,...).
object[]
Files to attach, up to 10 and 7 MB in total. Each is { name, source, type: "base64", media_type? } (media_type is guessed if omitted). Saved under files/ in a workstation or code sandbox workspace, and ~/Downloads on a cloud browser.
string
default:"user"
The sender. Leave it unset for normal user input.

Batch

string
required
"batch".
object[]
required
At least one single-message object, processed in order.

Examples

Send a single message

Send a batch of messages

Errors