Skip to main content
A document generation API is a service that an application sends data, text or instructions to over HTTP, and that returns a finished file: a Word document, an Excel workbook, a PowerPoint deck or a PDF. It replaces code that builds the file inside the application itself. There are two kinds. Some fill templates with data, so the structure is fixed in advance. Others compose the document from the content, so the structure follows what was asked for.

Why it matters for generated documents

  • A model writes text, not files. For a user to receive a DOCX or an XLSX, something has to turn that text into the format.
  • An agent can call it as one more tool. The API becomes a step in an AI agent’s loop.
  • Errors need codes. A machine-readable error lets the agent or application react without parsing a message.
  • Retries must be safe. An idempotency key makes a repeated request return the same document instead of creating and billing a second one.

Document generation in Doconda

Doconda creates and edits Word, Excel, PowerPoint and PDF with one request to POST /v1/documents, from a sentence (prompt), from your Markdown (content) or from your files (sources).
  • What you get: each Word, PowerPoint or Excel file comes with its PDF and page previews in outputs.
  • Time: an AI agent makes every document, about a minute at fast and a few minutes at standard. A direct call that passes 120 s answers 202 with the document still running; background: true answers 202 at once.
  • Retries: send Idempotency-Key. The same key and body within 24 h, in the same project, returns the same document and isn’t charged twice; a different body fails with 422 idempotency_key_reused.
  • Price: per delivered document, from €0.05 to €1.50 depending on the operation and quality level. Failed documents aren’t charged.
To read a file instead of making one, POST /v1/convert turns it into Markdown, text or another format with no AI.

Quickstart

Make your first Word document.

Create a document

From a sentence, your Markdown or your files.

Template-based vs template-free generation

Fill placeholders or compose from content.

Errors

Error codes and how idempotency works.