> ## 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.

# Structured output vs file output

> Structured output is JSON that follows a schema; file output is a binary document such as a DOCX or an XLSX.

**Structured output** is a language model's response in a format that follows a schema, usually JSON validated against
JSON Schema, so a program can read it without ambiguity. **File output** is a finished document, such as a
[DOCX](/en/glossary/docx), an [XLSX](/en/glossary/xlsx) or a PDF, that a person opens in their own program. They
complement each other: the first is for machines, the second for people.

## Why it matters when generating documents with AI

* A model doesn't reliably return binary files; it produces text or JSON that another step turns into a file.
* Next to the file, a structured report (status, warnings with code and location) lets the application decide without
  opening the document.
* For an [agent](/en/glossary/ai-agent), returning the whole file wastes context; a link and a summary are enough.
* Extracting a file's content as text (for example, [Markdown](/en/glossary/markdown)) is the reverse path.

## With Doconda

Each document returns its files in `outputs` (the Word file and its PDF, for example) and a JSON report. Each
[review](/en/guides/review) warning has its code, severity and location (`pages`, or `sheet` and `cells` in Excel).
Download links expire after 5 minutes; get new ones with `GET /documents/{id}/outputs` ([Quickstart](/en/quickstart)).

## Related

* [What is tool calling](/en/glossary/tool-calling)
* [What is Markdown](/en/glossary/markdown)
* [What is a document generation API](/en/glossary/document-generation-api)


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