POST /word/generate produces professional .docx output from a natural-language prompt. The agent handles heading hierarchy, line spacing, tables, images, footnotes, tracked changes, and complex layouts — all without you defining a template. Use it to automate proposals, contracts, business reports, letters, and any document you’d otherwise draft by hand.
The agent auto-accepts its own inline diff on the backend, so edits apply immediately — no manual review step required.
Request parameters
Natural-language description of the document you want. Up to 10,000 characters. Describe the purpose, audience, tone, and structure. Explicit hints like “use two-column layout” or “legal/contractual tone” are respected.
Resume an existing run. Pass the
run_id from a previous response to add sections, change tone, or update content in the existing document.file_id of an existing .docx to edit in-place. Upload the file first with POST /files (purpose: "init"). The agent inspects the document structure and applies targeted edits.Reference files the agent can cite in the document. Each entry is a
file_id. The agent uses these as sources and can insert inline links.Images to embed in the document. Each entry is an object with
image_id and tags. Upload images first with POST /images. If your prompt references images but none are attached, the preflight validator rejects the request upfront.Set to
true to run the job asynchronously. The response returns a task_id immediately. Use webhook_url to receive the result, or poll GET /tasks/{task_id}.Override the default output filename.
Supply a unique key to safely retry requests without producing duplicate runs.
Quickstart
Generate a document
Send a prompt describing the document. The response includes a
download_url for the finished .docx.Response shape
A successful synchronous response looks like this:| Field | Description |
|---|---|
run_id | Use this to resume the run or export to another format. |
download_url | Signed URL for the .docx file. Valid for 1 hour. |
summary | Agent’s description of what it built. |
credits_used | Credits deducted for this call. |
Common use cases
Reports
Letters and memos
Editing an existing document
Upload your draft first, then passinit_file to edit in-place.
.docx.
Including images
Upload images first, then reference them byimage_id. Use tags to tell the agent where to place each image.
Iterating with run_id
Passrun_id to resume the same document across multiple turns.
Exporting to other formats
Convert a completed run to PDF, HTML, plain text, or ODT usingPOST /runs/{run_id}/export.
pdf, html, txt, odt.
Writing quality
The agent is tuned to produce senior professional prose. It avoids overused words (“leverage”, “utilize”, “robust”, “seamless”), filler transitions (“Furthermore”, “Moreover”, “In summary”), and clichéd phrases. If you need a specific tone, state it explicitly in your prompt — “formal academic”, “conversational but direct”, or “legal/contractual” — and the agent follows it.Things to be aware of
- Table of contents is not supported. If your prompt asks for a TOC, the agent skips it and notes the omission in
summary. - Long documents (more than 5 pages) are built page-by-page. Add “first page preview only” to your prompt if you want a quick draft for review.
- Short iteration with
run_idis cheaper than starting over. Use follow-up turns to refine rather than regenerating from scratch.
Tips for better results
- Break large documents into sections: draft one section at a time using
run_idto build iteratively. - Use explicit structural hints for complex layouts: “use a two-column layout for the analysis section”, “start the chapter with a drop cap”.
- For legal or compliance documents, specify the governing jurisdiction and any required clauses.
- Ask for
async: trueon documents longer than 4 pages to avoid timeouts.
Related
- Runs and tasks —
run_idlifecycle, task polling, and status values - Async vs sync — when to use
async: trueand how to handle results - Preflight — validate your request before committing credits
- Credits — how generation costs are calculated

