Synchronous AI chat that can rewrite specific paragraphs, add or remove table rows, restructure sections, generate new content from templates, or transform an entire document. Pass document_html to give the AI context. Returns AI response text plus structural document changes (HTML edits, additions, deletions) with chunk IDs. One billable operation per document-modifying turn. For long-running edits or human-in-the-loop approval, use chat_async. Optional: model_tier (core/turbo/pro/max), thinking_depth (fast/balanced/deep), image_attachments for multimodal vision. RECOMMENDED for AI agents working with large documents (>20 pages): set response_mode=‘compact’ to skip the full HTML in the response (the AI returns only per-section diffs in chunk_diffs) and save thousands of tokens per turn. To read sections in compact mode, just send a natural-language request like ‘show me the force majeure section’ — the AI returns the content in the reply text. Always use natural language to describe what you want; the AI handles all internal section lookups.
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.
100000Unique session identifier. Reuse to continue a conversation.
256^[a-zA-Z0-9_\-\.]+$Current document HTML. Include data-chunk-id attributes on elements to enable targeted AI edits.
50000000User identifier. Automatically set from authentication — typically omit this.
256Inline images for vision-based analysis (base64-encoded).
20AI 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).
Response shape control. 'full' (default) returns the complete updated document HTML — required by web app editors and recommended for small documents (<20 pages). 'compact' (recommended for AI agents editing large documents) suppresses the full HTML and returns only per-section diffs (chunk_diffs) for changed sections, saving thousands of tokens per turn. To read sections in compact mode, just send a natural-language request like 'show me the force majeure section' — the AI returns the content in the chat reply text.
full, compact 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.