POST /v1/sessions/{session_id}/messages - Create message (user message triggers workflow)
POST /v1/sessions/{session_id}/messages
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Session ID (prefixed, e.g., sess_…)
Request Body required
Section titled “Request Body required ”Request to create a message
object
Runtime controls (model, reasoning, etc.)
object
Model ID to use for this message (format: model_{32-hex}). Overrides session and agent model settings.
Example
model_01933b5a00007000800000000000001The message to create
object
Array of content parts (text and image only)
Text content
object
Image content (base64 or URL)
object
Image file content (reference to uploaded image by ID)
object
Original filename (for display)
ID of the uploaded image (format: img_{32-hex})
Example
img_01933b5a00007000800000000000001Message role (always “user” for API-created messages)
Request-level metadata
Tags for the message
Responses
Section titled “ Responses ”Message created successfully
A message in the conversation
object
Message content as array of content parts (text, images, tool calls, tool results)
Text content
object
Image content (base64 or URL)
object
Image file content (reference to uploaded image by ID)
object
Original filename (for display)
ID of the uploaded image (format: img_{32-hex})
Example
img_01933b5a00007000800000000000001Tool call content (assistant requesting tool execution)
object
Tool result content (result of tool execution)
object
ID of the tool call this result corresponds to
Runtime controls (model, reasoning, etc.)
object
Model ID to use for this message (format: model_{32-hex}). Overrides session and agent model settings.
Example
model_01933b5a00007000800000000000001Timestamp when the message was created
Unique message ID (format: message_{32-hex})
Example
message_01933b5a00007000800000000000001Message-level metadata
Message role
Thinking content from extended thinking models (Anthropic Claude) This is the model’s chain-of-thought reasoning before producing the response. Must be included in subsequent API calls when thinking is enabled.
Cryptographic signature for thinking content (Anthropic Claude) Required when sending thinking back in subsequent API calls.
Invalid ID format
Session not found
Internal server error