DocsRouter

Getting Started

Make your first DocsRouter OCR request

Getting Started

DocsRouter is in early access. This guide uses the native /v1/ocr endpoint and the default balanced routing policy.

1. Create an account

Visit the DocsRouter signup page, then open the dashboard.

2. Create an API key

In API Keys, create a named key and copy it immediately. Store it in a server-side environment variable; never expose it in browser code or a public repository.

export DOCSROUTER_API_KEY="your_api_key"

3. Add credits

DocsRouter uses prepaid credits. Check the dashboard for the billing options currently enabled for your account. Vision-model requests are billed at provider cost plus a 5% platform fee.

4. Extract an image

curl -X POST https://api.docsrouter.com/v1/ocr \
  -H "Authorization: Bearer $DOCSROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/invoice.png",
    "strategy": "balanced",
    "options": {"output_format": "markdown"}
  }'

The balanced policy currently maps to google/gemini-2.5-flash. This is a fixed policy, not an adaptive comparison or fallback system.

5. Choose an explicit model

Use GET /v1/models to read the current priced image-model list, then pass an ID:

curl -X POST https://api.docsrouter.com/v1/ocr \
  -H "Authorization: Bearer $DOCSROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/invoice.png",
    "model": "openai/gpt-4o-mini"
  }'

6. Process a multi-page PDF

PDF_BASE64=$(base64 -i document.pdf | tr -d '\n')

curl -X POST https://api.docsrouter.com/v1/ocr \
  -H "Authorization: Bearer $DOCSROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "base64": "'"$PDF_BASE64"'",
    "mime_type": "application/pdf",
    "strategy": "quality",
    "options": {"extract_tables": true}
  }'

Read result.pages for page-level output and result.text for the combined extraction.

Validate before automating

DocsRouter does not publish accuracy or latency guarantees and does not retry low-confidence output through another model. Test against representative documents and keep human review for high-impact decisions.

Next steps

  • Review the complete Native OCR reference.
  • See the current catalog and strategy mappings on Models.
  • Handle errors and application-controlled retries with Errors.

On this page