Getting Started
Start extracting text from documents in minutes
Getting Started
Follow this guide to set up your DocsRouter account and make your first API request.
1. Create an Account
Visit the DocsRouter Dashboard to create your account. You can sign up with your email or use social login providers.
2. Generate an API Key
Once logged in, navigate to the API Keys section in the dashboard sidebar.
- Click Create New Key.
- Give your key a name (e.g., "Development", "Production").
- Click Create.
- Copy your API Key immediately. For security reasons, you won't be able to see it again.
3. Add Credits
DocsRouter uses a prepaid credit system. To use paid models or process large volumes:
- Go to the Settings or Billing page.
- Click Add Credits.
- Choose an amount and complete the payment via Stripe.
- Your balance will update immediately.
Free Tier
New accounts may come with a small starting balance to test the API. Check your dashboard for details.
4. Make Your First Request
DocsRouter provides an OpenAI-compatible API. Use cURL or any HTTP client to make requests.
Extract Text from an Image
curl -X POST https://api.docsrouter.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-2.0-flash-001",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "Extract all text from this document"},
{"type": "image_url", "image_url": {"url": "https://example.com/invoice.png"}}
]
}]
}'Extract Text from a PDF
For PDF documents, use the file content type with the mistral-ocr engine for best results:
curl -X POST https://api.docsrouter.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-2.0-flash-001",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "Extract all text from this PDF"},
{
"type": "file",
"file": {
"filename": "document.pdf",
"file_data": "https://example.com/document.pdf"
}
}
]
}],
"plugins": [{
"id": "file-parser",
"pdf": {"engine": "mistral-ocr"}
}]
}'Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1734567890,
"model": "google/gemini-2.0-flash-001",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "INVOICE #001\nDate: December 15, 2024\n..."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 1200,
"completion_tokens": 150,
"total_tokens": 1350
},
"docsrouter": {
"confidence": 95,
"tables_detected": 1,
"total_cost_cents": 1.5,
"processing_time_ms": 1250
}
}Next Steps
- Check the API Reference for full endpoint documentation.
- Browse Supported Models to find the right balance of cost and speed.
- Learn about DocsRouter extensions for table extraction and more.