POST
/ai/chats/sendSend a message and stream the AI reply
Sends a message to an AI chat and streams the reply as server-sent events. Omit chatId to start a new chat; the stream ends with data: [DONE], and requests are limited to 25 per minute per user.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Message content and optional chat, page context, and attachment references.
attachmentIdsarray<string>optional
Files previously uploaded via `/ai/chats/upload`.
chatIdstringoptional
Omit to start a new chat.
contentstringrequired
Message text. Maximum 50,000 characters.
contextPageIdstringoptional
Page the user is currently viewing, used as ambient context.
mentionedPageIdsarray<string>optional
Pages explicitly referenced in the message.
200Returns a server-sent event stream of the AI reply. Each `data:` line contains a JSON event, and the stream ends with `data: [DONE]`.
429Returned when the user exceeds the limit of 25 requests per minute.
errorstringoptional
Reason phrase, for example `Bad Request`.
messagestringoptional
statusCodeintegeroptional
Error handling
A 429 is returned when the user exceeds 25 requests per minute. content is required and must not exceed 50,000 characters; chatId, contextPageId, and each ID in attachmentIds and mentionedPageIds must be UUIDs when supplied. Files in attachmentIds must have been uploaded through /ai/chats/upload.