Edit, draft, or restructure a document using natural language. Preserves tables, styling, and formatting.
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 only to load or replace the document; once a session holds a document the server persists it across turns, so omit it on follow-up turns. To replace the whole document with EXACT content you already hold, pass that content in document_html (a verbatim load — the AI never re-types it) or upload it via upload_document_base64; describing the content only in message makes the AI author it, which can drift from your text. Returns AI response text plus structural document changes (HTML edits, additions, deletions) with chunk IDs. One billable operation per document-modifying turn; very large multi-section edits bill one operation per 25 sections changed. 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.
Request
- Base URL: https://api.superdocs.app
- URL: https://api.superdocs.app/v1/chat
- Auth: HTTP bearer
Headers
Request body
Example request
{
"approval_mode": "approve_all",
"document_html": "<div data-chunk-id=\"550e8400-e29b-41d4-a716-446655440000\"><h2>Section 3</h2><p>Terms and conditions...</p></div>",
"message": "Add a confidentiality clause to section 3",
"model_tier": "core",
"session_id": "session_abc123"
}Response
Successful Response
Example response
{
"document_changes": {
"changes_summary": "1 section edited, rest untouched",
"updated_html": "<div data-chunk-id=\"550e8400-e29b-41d4-a716-446655440000\"><h2>Section 3</h2><p>Updated content...</p></div>",
"version_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
},
"response": "I've added a confidentiality clause to section 3 covering non-disclosure obligations.",
"session_id": "session_abc123",
"usage": {
"monthly_limit": 500,
"monthly_remaining": 458,
"monthly_used": 42,
"subscription_tier": "free",
"was_billable": true
}
}Changes
No recorded changes to this operation across all 1 revision of this API.