v29

latestOpenAPI 3.1.2raw.githubusercontent.com2026-08-014117755.2 KB
Messages

Send Message

Sends a new message to an existing chat. Blocks until the model response is complete and returns the message response.

post/chats/{chatId}/messages

Path parameters

chatIdstring required

The unique identifier of the chat.

Request body

messagestring required

The prompt or instruction to send to the model.

systemPromptstring

System-level context for the chat, such as frameworks or development environment details.

mcpServerIdsstring[]

MCP server IDs to enable. When omitted, uses default enabled servers.

Response

A single message in a chat.

idstring required

Unique message identifier.

chatIdstring required

ID of the chat this message belongs to.

role'user' | 'assistant' required

Who produced this message.

createdAtstring date-time required

ISO timestamp when the message was created.

updatedAtstring date-time required

ISO timestamp when the message was last updated.

contentstring required

The trailing prose of the message — the agent’s closing summary, or the user’s message text. Empty string when there is no closing prose.

finishReason'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other' nullable required

The reason why message generation finished, including standard completion reasons and error states.

restorableboolean required

True when this is an assistant message that produced restorable code and is not the currently active code.

authorIdstring nullable required

ID of the user who authored a user message; null for assistant messages.