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 underresult.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 singleParseResult.compare— Process one document across several providers in parallel and receive aCompareResultcontaining every provider’s output side-by-side.
Two modes of operation
Hosted (managed credentials)
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.
BYOK (bring your own keys)
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.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.
Hosted uploads are capped at 100 MB. If you use BYOK mode directly, each provider’s native file-size limits apply instead.
Get started
Quickstart
Parse your first document with the TypeScript SDK in a few minutes.
Authentication
Get your FileRouter API key and learn how to pass it in every request.
SDK Installation
Add
@file_router/sdk to your project and explore the full SDK reference.CLI Installation
Install
@file_router/cli or use it directly with npx.