@doconda/sdk and call documents.create with
format: "docx" and what you want in prompt. Doconda writes the content, applies any style you ask for in the same
sentence and returns an editable .docx and its PDF, with no templates or layout code.
Steps
- Create an API key in the dashboard, under API keys, and store it in
DOCONDA_API_KEY. - Install the SDK (Node 20 or later, no runtime dependencies):
npm install @doconda/sdk. - Create the document and save it to disk.
documents.create waits for the document to be ready, like a call to an LLM. If it takes longer than 120 seconds,
the SDK keeps waiting for you.
What you get back
- An editable
.docx: the look lives in the Word styles, and the layout adapts to the kind of document (doc.type: report, letter, contract, memo or minutes). - Its PDF, and
doc.outputswith direct links (they expire after 5 minutes;documents.outputs(id)gives you new ones). doc.status:ready,ready_with_warnings,needs_revieworfailed(not charged;doc.errorsays why).doc.style_unsupported: whatever you asked for that couldn’t be applied.
Limits
- Use the SDK on your server, never in the browser: your API key gives access to every document in the project.
- With
quality: "fast"you get the basic style; charts, tracked changes or your template’s design needstandardorbest. - If you leave out
formatand the sentence doesn’t make the file type clear, it fails withformat_unclearand isn’t charged.
FAQ
Does it work in serverless functions?
Does it work in serverless functions?
Yes. The SDK works on Node 20 or later, serverless functions included.
What if my model already wrote the text?
What if my model already wrote the text?
Pass it in
content: { markdown }: Doconda only lays it out, faster and cheaper.Can I show the document while it's being written?
Can I show the document while it's being written?
Yes, with
documents.stream. See Watch the document live.Is there a Python SDK?
Is there a Python SDK?
Yes, with the same methods:
pip install doconda. See Python SDK.