> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doconda.com/llms.txt
> Use this file to discover all available pages before exploring further.

# What is a document generation API

> A document generation API creates files (Word, Excel, PowerPoint, PDF) from data or text through an HTTP request.

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. Some fill [templates](/en/glossary/template-based-generation) with data; others
compose the document from the content.

## Why it matters when generating documents with AI

* A language model produces text; for the user to receive a file, that text has to be turned into a format such as
  [DOCX](/en/glossary/docx) or [XLSX](/en/glossary/xlsx).
* An [AI agent](/en/glossary/ai-agent) can call the API as one more tool.
* The API should return clear errors and a report of what it couldn't do, so the agent or application can react.
* Retried requests must be safe: an idempotency key avoids creating the same document twice.

## With Doconda

Doconda creates, reviews and edits Word, Excel, PowerPoint and PDF files with one request to `POST /v1/documents`, from
a sentence, from your Markdown or from your files. Each file comes with its PDF, page previews and a report
([Create](/en/guides/create)). The [quickstart](/en/quickstart) makes your first Word document in under 5 minutes.

## Related

* [What is an AI agent](/en/glossary/ai-agent)
* [Template-based vs template-free generation](/en/glossary/template-based-generation)
* [Structured output vs file output](/en/glossary/structured-output)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.