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

# FileRouter: Document Parsing Across Any Provider

> FileRouter gives you one API for document parsing across LlamaParse, Mistral OCR, and Datalab — use managed credentials or bring your own provider keys.

FileRouter is a provider-neutral document parsing service that lets you send a file once and get structured output back — without locking you into a single provider. Whether you need markdown output from a scanned PDF, page-by-page results, or a side-by-side quality comparison across providers, FileRouter exposes one consistent contract regardless of which parsing engine does the work underneath.

## What FileRouter does

When you parse a document through FileRouter, you choose a provider — LlamaParse, Mistral OCR, or Datalab — and specify the outputs you want. FileRouter handles authentication, submission, polling, and result normalisation on your behalf. Normalized values always live under `result.outputs`; metadata like page count, timing, and warnings stay at the result root, making results predictable regardless of which provider you use.

The two core operations are:

* **`parse`** — Process one document with one explicit provider and receive a single `ParseResult`.
* **`compare`** — Process one document across several providers in parallel and receive a `CompareResult` containing every provider's output side-by-side.

## Two modes of operation

<CardGroup cols={2}>
  <Card title="Hosted (managed credentials)" icon="cloud">
    Use FileRouter's managed provider credentials. You authenticate with a single FileRouter API key and FileRouter handles provider billing, quotas, and key rotation. Hosted binary uploads are limited to **100 MB**. Results expire after **7 days**; job records are removed after **30 days**.
  </Card>

  <Card title="BYOK (bring your own keys)" icon="key">
    Supply your own provider API keys directly. Use the `FileRouter` class from the SDK or pass `--local` to the CLI. Your document never travels through FileRouter's infrastructure — requests go straight to the provider.
  </Card>
</CardGroup>

## Three surfaces

You can reach FileRouter from whichever environment suits your workflow.

**TypeScript SDK (`@file_router/sdk`)** — Install into any Node.js project, call `FileRouterClient` for hosted mode or `FileRouter` for BYOK, and parse or compare documents with full TypeScript types.

**CLI (`@file_router/cli`)** — Parse and compare documents from the terminal with a single command. Run `npx @file_router/cli login` once, then start parsing immediately — no permanent installation required.

**REST API** — Every SDK call maps to the hosted Hono API. Send an `Authorization: Bearer <key>` header with each request. The OpenAPI 3.1 contract is available at `/api/openapi.json`.

## Supported inputs

The SDK accepts HTTP URLs, local file paths, `File`, `Blob`, `ArrayBuffer`, typed array views, and web streams. You pass whatever form your data is already in — FileRouter resolves it before sending it upstream.

<Note>
  Hosted uploads are capped at 100 MB. If you use BYOK mode directly, each provider's native file-size limits apply instead.
</Note>

## Get started

<CardGroup cols={2}>
  <Card title="Quickstart" icon="bolt" href="/quickstart">
    Parse your first document with the TypeScript SDK in a few minutes.
  </Card>

  <Card title="Authentication" icon="lock" href="/authentication">
    Get your FileRouter API key and learn how to pass it in every request.
  </Card>

  <Card title="SDK Installation" icon="cube" href="/sdk/installation">
    Add `@file_router/sdk` to your project and explore the full SDK reference.
  </Card>

  <Card title="CLI Installation" icon="terminal" href="/cli/installation">
    Install `@file_router/cli` or use it directly with `npx`.
  </Card>
</CardGroup>
