﻿# How OpenRouter file parsing turns a PDF into model input

Understand OpenRouter PDF processing from input_file and file blocks to native model input, OCR engines and API-specific citation or reusable annotation records.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/learn-openrouter-pdf-pipeline/
Language: en

A PDF is a container for text, layout and sometimes scanned images. OpenRouter can pass it natively to a compatible model or parse it before inference. The PDF documentation explains both paths and distinguishes Responses citations from Chat Completions file annotations, preventing an application from treating every file-related field as equivalent reusable content.

## Choose the API-specific file representation

Responses accepts PDF input through `input_file` parts with a public file URL or embedded data. Chat Completions uses its documented file content part. For a hypothetical report-analysis app, local files need an actual supported transfer representation rather than a workstation path string. Keep the source document identity with the request so later analysis can refer to the exact report that was processed.

## Understand native and parsed paths

The documented default uses native file support when the selected model has it, otherwise a parsing engine. The file-parser plugin allows explicit engine configuration, including native, Mistral OCR and Cloudflare processing. These are different transformations before the answer is generated. For a scanned report, text extraction quality may become a separate source of error from the model’s interpretation of successfully extracted content.

## Account for extracted-image limits

The current documentation describes a cap of 8 extracted images forwarded through the OCR path, with surplus images dropped while extracted text is retained. A downstream text-only model receives parsed text without those images. Therefore a successful PDF request does not prove every chart reached the model visually. For the report app, verify the specific chart-dependent task rather than assuming full visual coverage from a completed parse.

## Do not confuse citations with reusable annotations

Chat Completions may return structured file annotations that can be included in later requests to avoid reparsing according to the documented workflow. Responses returns file-citation annotations instead; the PDF page explicitly says these cannot be replayed for that optimization. Preserve the API distinction. A citation can help identify a source without containing the parsed file state the other endpoint expects for reuse.

## Evaluate the complete document pipeline

Use a representative report with known text and a chart that matters to the question. Check transfer, parsing or native input, and the final answer separately. If a cited value is wrong, inspect whether the source content reached the model correctly before changing the prompt. This layered evaluation makes PDF support explainable without promising that every page layout, image and citation is preserved identically by every engine or model.

## Documentation and further study

- [PDF Inputs](https://openrouter.ai/docs/guides/overview/multimodal/pdfs).

- [OpenRouter API Reference - Complete Documentation](https://openrouter.ai/docs/api-reference/overview).

- [Provider Routing - Smart Multi-Provider Request Management](https://openrouter.ai/docs/guides/routing/provider-selection).

Related engineering guides: [Structured output through OpenRouter: when to use a JSON schema](/journal/openrouter-json-schema/); [OpenRouter usage: reconciling tokens and request cost](/journal/openrouter-usage-accounting/).
