API Reference
Complete documentation for the OCR Omega REST API.
Note: No official SDKs are available yet. Use the REST API directly with your preferred HTTP client. See code examples below.
Base URL
https://api.ocr-omega.com
Authentication
All API requests require authentication using an API key. Include your key in the X-API-Key header. Get your API key from the dashboard.
curl -X POST https://api.ocr-omega.com/v1/ocr \ -H "X-API-Key: sk_live_your_api_key" \ -F "file=@document.pdf"
Endpoints
GET
/healthCheck if the API is running and responsive
POST
/v1/ocrSubmit a document for OCR processing. Supports PDF, PNG, JPEG.
GET
/v1/jobs/{jobId}Get the status and results of an OCR job
POST /v1/ocr
Submit a document for OCR processing. The system automatically analyzes complexity and routes to the optimal provider.
Request
POST /v1/ocr Content-Type: multipart/form-data file: <binary> (required) - PDF, PNG, or JPEG file
Response (202 Accepted)
{
"jobId": "550e8400-e29b-41d4-a716-446655440000",
"status": "pending",
"pageCount": 5,
"creditsReserved": 5,
"estimatedCompletionSeconds": 10
}Credit Consumption
- Simple documents: 1 credit/page
- Medium complexity: 3 credits/page
- Complex documents: 5 credits/page
GET /v1/jobs/{jobId}
Retrieve the status and results of an OCR job.
Response (200 OK - Completed)
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"pages_processed": 5,
"credits_used": 5,
"created_at": 1706745600000,
"completed_at": 1706745610000,
"results": [
{
"document_metadata": {
"source_model": "paddle",
"page_dimensions": { "width": 2480, "height": 3508 },
"global_confidence": 0.95
},
"content_blocks": [
{
"block_id": 1,
"type": "text",
"geometry": { "x": 0.1, "y": 0.2, "width": 0.8, "height": 0.05 },
"text": "Invoice #12345",
"confidence": 0.98
}
],
"raw_markdown": "# Invoice\n\n**Date:** 2024-01-15",
"pipeline_metadata": {
"complexity_score": 8.5,
"provider_used": "paddle",
"provider_reason": "Simple document - using PaddleOCR"
}
}
]
}Rate Limits
API requests are rate limited based on your plan:
- Free: 10 requests/hour, 100 requests/day
- Starter: 100 requests/minute
- Professional: 500 requests/minute
- Business: 2,000 requests/minute
Error Codes
400Bad request (invalid file, too large, etc.)
401Unauthorized (missing or invalid API key)
402Payment required (insufficient credits)
404Job not found
429Rate limit exceeded
500Internal server error
Code Examples
JavaScript / Node.js
const formData = new FormData();
formData.append('file', fs.createReadStream('document.pdf'));
const response = await fetch('https://api.ocr-omega.com/v1/ocr', {
method: 'POST',
headers: { 'X-API-Key': 'sk_live_your_api_key' },
body: formData
});
const { jobId } = await response.json();
// Poll for results
const result = await fetch(`https://api.ocr-omega.com/v1/jobs/${jobId}`, {
headers: { 'X-API-Key': 'sk_live_your_api_key' }
});
console.log(await result.json());Python
import requests
# Submit OCR job
with open('document.pdf', 'rb') as f:
response = requests.post(
'https://api.ocr-omega.com/v1/ocr',
headers={'X-API-Key': 'sk_live_your_api_key'},
files={'file': f}
)
job_id = response.json()['jobId']
# Get results
result = requests.get(
f'https://api.ocr-omega.com/v1/jobs/{job_id}',
headers={'X-API-Key': 'sk_live_your_api_key'}
)
print(result.json())cURL
# Submit OCR job
curl -X POST https://api.ocr-omega.com/v1/ocr \
-H "X-API-Key: sk_live_your_api_key" \
-F "file=@document.pdf"
# Get results
curl https://api.ocr-omega.com/v1/jobs/{jobId} \
-H "X-API-Key: sk_live_your_api_key"