@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 plus its PDF, with no
templates or layout code.
Generate the document
- Create an API key in the dashboard, under API keys, and store it in
DOCONDA_API_KEY. - Install the SDK (Node.js 20 or later; its only runtime dependency is
zod):npm install @doconda/sdk. - Create a file named
example.mjswith the following code:
example.mjs
- Run it with
node example.mjs.
ready report standard, and report.docx and report.pdf on disk. documents.create waits until the
document finishes, like a call to an LLM, even past the API’s 120 s direct-call limit.
What you get back
- An editable
.docx: the look lives in the Word styles, and the layout fits the kind of document (doc.type:report,letter,contract,memoorminutes). - Its PDF, and
doc.outputswith direct links. They expire after 5 minutes;documents.outputs(id)gives new ones. doc.status:ready, orfailedwithdoc.errorsaying why. A failed document isn’t charged.
Price and time
Withquality: "auto" (the default), Doconda picks the level the request needs and, when in doubt, the cheaper one.
If your model already wrote the text, pass it in
content: { markdown } instead: Doconda only lays it out, for €0.20
at standard.
Behavior to be aware of:
- Use the SDK on your server, never in the browser: the API key gives access to every document in its project.
- If you leave out
formatand the prompt doesn’t make the file type clear, it fails withformat_unclearand isn’t charged. - With
auto, your balance must cover the highest level Doconda may pick, or the call fails with402 insufficient_balance. Setmax_quality: "standard"to cap it.
FAQ
Does it work in serverless functions?
Does it work in serverless functions?
Yes, on Node.js 20 or later. Set the function’s timeout to a few minutes, or create with
createInBackground and
receive a webhook when it finishes.Can I show progress while it's being made?
Can I show progress while it's being made?
Yes. Create with
createInBackground, then read documents.events(id): it yields each step as it happens. See
Events.Is there a Python SDK?
Is there a Python SDK?
Yes, with the same methods in
snake_case: pip install doconda. See Python SDK.