Skip to main content
Every parse() or compare() call produces a ParseResult whose normalized data lives exclusively under result.outputs. You tell FileRouter exactly which outputs you want by passing an outputs array in your options — you are never charged for, or forced to receive, outputs you did not ask for. Top-level result fields like pageCount, usage, warnings, and timing remain at the root of the result regardless of which outputs you request.

Requesting outputs

Pass an array of output IDs to outputs in your parse options. You must request at least one:
request-outputs.ts

Available output IDs

The valid output identifiers are exported from the SDK as parseOutputIds:
output-ids.ts
The document split into semantic chunks suitable for embedding and retrieval. Each chunk carries enough context to be inserted into a vector store. Currently supported by Datalab only.
The document rendered as an HTML string. Preserves headings, lists, and basic table markup. Currently supported by Datalab only.
An array of ParsedImage objects extracted from the document. Each image may include a URL, a base64 data string, a caption, a bbox (bounding box), and the pageNumber it appeared on. Supported by LlamaParse, Mistral OCR, and Datalab.
The document as structured JSON. The exact shape is provider-native — LlamaParse returns its items representation; Mistral OCR and Datalab return their own JSON structures. Supported by LlamaParse, Mistral OCR, and Datalab.
The full document as a Markdown string. This is the most universally supported output — all three providers produce it. When pages is also requested, per-page Markdown is available on each page object as well.
Document-level metadata as a key-value map (Record<string, unknown>). Supported by LlamaParse, Mistral OCR, and Datalab.
An array of ParsePage objects — one per document page. Each page object carries the pageNumber and any per-page fields that the provider produced (Markdown, text, HTML, images, tables, confidence, dimensions, and warnings). Supported by LlamaParse, Mistral OCR, and Datalab.
An array of ParsedTable objects extracted from the document. Each table may include a markdown representation, an html representation, raw rows, a format hint, and the pageNumber. Supported by LlamaParse, Mistral OCR, and Datalab.
The full document as plain text, stripped of Markdown formatting. Supported by LlamaParse only.

Provider output support

Not every provider supports every output. If you request an output that the provider you selected does not support, FileRouter raises a FileRouterError before making any API call. No credits are consumed and no partial results are returned. Check the provider’s declared capabilities before requesting unusual outputs.
You can inspect what a configured provider supports at runtime:
check-capabilities.ts

Result shape reference

result.outputs
Partial<ParseOutputValues>
All normalized parse outputs live here, keyed by the output ID you requested. Fields are only present if you included the corresponding ID in your outputs array.
outputs.markdown
string
Full document Markdown.
outputs.text
string
Full document plain text (LlamaParse only).
outputs.html
string
Full document HTML (Datalab only).
outputs.pages
ParsePage[]
Per-page content objects, sorted by page number.
outputs.images
ParsedImage[]
All extracted images across the document.
outputs.tables
ParsedTable[]
All extracted tables across the document.
outputs.json
unknown
Provider-native structured JSON.
outputs.metadata
Record<string, unknown>
Document-level metadata.
outputs.chunks
unknown
Semantic chunks for retrieval (Datalab only).
result.pageCount
number
Total number of pages detected in the document.
result.provider
string
The ID of the provider that produced this result (e.g. "llamaparse").
result.warnings
ParseWarning[]
Any warnings raised during parsing, including per-page issues. Each warning has a code, a message, and an optional pageNumber.
result.timing
object
Parse timing data: startedAt (ISO string), completedAt (ISO string), and durationMs (number).
result.usage
object
Provider-reported consumption: pages, credits, and costUsd — each optional depending on what the provider reports.
result.quality
object
Provider-native quality score, if available. Includes a score and an optional scale. Do not compare scores across different providers — each provider uses its own scale.

Including the raw provider response

By default, FileRouter discards the original provider response after normalizing it. If you need to inspect the native response — for debugging, auditing, or accessing data that FileRouter does not yet normalize — pass includeRaw: true:
include-raw.ts
includeRaw: true is opt-in for good reason. Provider responses can be very large — especially when the document contains many images or detailed per-page JSON. Enabling it in production increases result storage size and memory pressure. Use it for debugging and inspection, not as a default.