Send a message to SuperDocs AI and receive an AI response with optional document edits.
The AI agent can edit, search, create, and delete document sections based on your message. Provide document_html to give the AI context about the current document state. Returns the AI response text and any document changes (HTML updates, creates, deletes). Each message that triggers a document action counts as one billable operation.
Optional parameters:
When approval_mode is ‘ask_every_time’, the response includes pending changes requiring review via the async workflow (use chat_async instead for full HITL support).
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Send a message to the AI assistant with optional document context.
Your message to the AI assistant.
Unique session identifier. Reuse to continue a conversation.
Current document HTML. Include data-chunk-id attributes on elements to enable targeted AI edits.
User identifier. Automatically set from authentication — typically omit this.
Inline images for vision-based analysis (base64-encoded).
AI model to use: 'core' (default, fast), 'turbo' (fastest), 'pro' (advanced reasoning), 'max' (most capable).
Reasoning depth: 'fast', 'balanced' (default), or 'deep'. Controls how much analysis the AI performs.
Change review mode: 'approve_all' (default, auto-applies changes) or 'ask_every_time' (pauses for your review).
Successful Response
AI response with optional document changes and usage data.
AI assistant's response text.
Session identifier for this conversation.
Document modifications made by the AI. Present only when the document was changed.
Operation usage data. Present for authenticated users with usage tracking.