Durable document parsing across providers.
FileRouter gives you one TypeScript SDK and CLI for durable document parsing across providers. Choose a parser, compare the same document across parsers, or call providers directly with your own keys.
Each parser has its own SDK, input rules, options, async job flow, and response shape. Supporting more than one usually means rebuilding the same document pipeline. FileRouter handles that work behind one interface:
- Inputs: pass a file path, URL,
File,Blob, buffer, or stream. - Provider adapters: keep each provider's authentication and options separate without changing the rest of your app.
- Long-running jobs: hosted processing manages uploads, provider submission, polling, timeouts, result storage, and cleanup.
- Consistent results: work with the same page numbering, outputs, timing, warnings, and errors across providers.
- Side-by-side comparisons: parse a document with multiple providers at once and keep each success or failure in one result.
Start with one parser today. Switching or comparing later is a configuration change, not another document integration.
Install the SDK:
npm install @file_router/sdkParse a document with the hosted API:
import { FileRouterClient } from "@file_router/sdk"
const client = new FileRouterClient({
apiKey: process.env.FILEROUTER_API_KEY,
})
const result = await client.parse("https://example.com/report.pdf", {
provider: "llamaparse",
outputs: ["markdown"],
})
console.log(result.outputs.markdown)Or use the CLI:
npx @file_router/cli@latest login
npx @file_router/cli@latest parse report.pdf| Hosted API | Direct with your keys | |
|---|---|---|
| Best for | The fastest setup | Keeping provider calls in your runtime |
| Authentication | One FileRouter API key | Your provider API keys |
| Document sent through | FileRouter, then the selected provider | The selected provider only |
| TypeScript | FileRouterClient |
FileRouter |
| CLI | Default after filerouter login |
Add --local |
Direct TypeScript example:
import { FileRouter } from "@file_router/sdk"
import { llamaparse } from "@file_router/sdk/llamaparse"
const router = new FileRouter({
providers: { llamaparse: llamaparse() },
})
const result = await router.parse("./report.pdf", {
provider: "llamaparse",
outputs: ["markdown"],
})- LlamaParse for layout-aware document parsing.
- Mistral OCR for OCR with structured document output.
- Datalab for document conversion and extraction.
More adapters are coming.
FileRouter requires Node.js 22.14 or newer.
vp install
pnpm devRun the checks before pushing changes:
pnpm check
pnpm testFileRouter is open source under the MIT License.