Skip to main content
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, an 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, returning the whole file wastes context; a link and a summary are enough.
  • Extracting a file’s content as text (for example, 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 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).