Assumes you have installed an SDK: TypeScript or Python.
documents.create sends the request and waits until the document finishes, like a call to an LLM. If it takes longer
than 120 s, the API answers 202 and the SDK keeps waiting for you. In Python, responses are dicts: doc.id is
doc["id"].
Create from a sentence
Setprompt (3 to 8,000 characters) and Doconda writes the content. Any look you describe in it (“blue headings”, “with
a table of contents”) is applied too; style takes the look separately.
doc.type says what Doconda decided it is (report, letter, contract, memo or minutes for Word and PDF), which
sets its base layout. You don’t choose it: describe the document in prompt and the look in style.
Create from your Markdown
Setcontent.markdown (up to 500,000 characters) and Doconda only lays it out, without rewriting it. It costs less than
from a sentence: €0.20 instead of €0.50 at standard.
Choose the format
format decides the file. Word, PowerPoint and Excel also come with their PDF, and every file with one PNG preview
per page.
Without
format, Doconda infers it from prompt. When it can’t tell, the document ends failed with format_unclear
and isn’t charged.
Choose the quality
quality sets how much work the agent puts in, and the price. The default, auto, lets Doconda pick; max_quality
caps what it may pick.
fast takes about a minute and can’t copy a file’s design. With auto, your balance must cover the highest level
Doconda may pick before it starts. See quality levels and
pricing.
Add your files as sources
sources takes up to 5 documents that the AI reads before writing, and up to 10 pictures it places in the document.
Each entry is a file_… from files.upload, a doc_…, { url } or { data, filename }.
content, sources only carries pictures: place them from the Markdown with , where 1 is the
first picture in sources. To copy a file’s look, see copy the design of a file.
Download the result
download asks for fresh links and fetches the file. The links in doc.outputs expire after 5 minutes;
documents.outputs(id) returns new ones until the document’s retention ends (30 days by default, doc.expires_at).
Check the status
create returns when the document reaches ready, failed or canceled. A failed or canceled document isn’t an
exception, so check status.
For every
error.code, see when a document fails.
Create in the background
createInBackground (Python: create_in_background) answers at once with status: "queued", so a job queue or a web
request doesn’t hold the connection.
wait follows the document’s events and reconnects up to 5 times if the connection drops. To be notified instead of
waiting, use webhooks.
Behavior to be aware of:
max_qualityonly works withquality: "auto". Any other combination is rejected with422 input_invalid.- Each
createcall sends its ownIdempotency-Key, so the SDK’s retries never create a second document. To make your own retries safe, see idempotency. name(up to 200 characters) names the downloaded files;retentionoverrides the project’s (none,1d,7d,30dor90d).
Next steps
Edit a file
Change an existing document and see what changed.
Build artifacts
Web pages that store data.
Handle errors
Codes, retries and idempotency.
SDK reference
Every method and what it returns.