Loading...
Loading...
Get started with OpenOCR in 5 minutes.
Sign up for a free account at open-ocr.com/signup. New accounts include credits to get started. Then generate an API key from your dashboard.
Account and API-key creation require a human (CAPTCHA). AI agents: ask your user for an sk-ocr- key.
mistral-mistral-ocr-4-1 (Mistral OCR 4.1). This is our recommended default, and it reads multi-page PDFs natively.google-gemini-3.1-flash-lite.Send a POST request to the OCR endpoint with your API key and an image URL. Every request requires an Idempotency-Key header to prevent duplicate processing:
curl -X POST https://api.open-ocr.com/v1/ocr \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"engine": "mistral-mistral-ocr-4-1",
"input": {
"type": "url",
"url": "https://tesseract-ocr.github.io/tessdoc/images/eurotext.png"
}
}'{
"request_id": "req_abc123",
"status": "succeeded",
"engine": "mistral-mistral-ocr-4-1",
"extracted_text": "INVOICE #12345\nDate: January 15, 2024\n...",
"extracted_text_preview": "INVOICE #12345...",
"cost_debited": 0.005,
"remaining_balance": 0.995,
"provider_latency_ms": 280
}Cost per page depends on the engine you choose. See the pricing page for current rates. The remaining_balance field shows your updated credit balance.
You can also send images as base64-encoded data — useful when you have files in memory:
# Encode a local file and send it
BASE64=$(base64 -w0 receipt.png)
curl -X POST https://api.open-ocr.com/v1/ocr \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"engine": "mistral-mistral-ocr-4-1",
"input": {
"type": "base64",
"data_base64": "'$BASE64'",
"mime_type": "image/png"
}
}'OpenOCR is a plain REST + JSON API — no SDK install required. Use whatever HTTP client you already have.
import uuid
import requests
resp = requests.post(
"https://api.open-ocr.com/v1/ocr",
headers={
"Authorization": "Bearer sk-ocr-your-api-key",
"Content-Type": "application/json",
"Idempotency-Key": str(uuid.uuid4()), # new UUID per logical request
},
json={
"engine": "mistral-mistral-ocr-4-1",
"input": {"type": "url", "url": "https://example.com/receipt.png"},
},
)
resp.raise_for_status() # an error envelope has no "status" field
result = resp.json()
if result["status"] != "succeeded":
raise RuntimeError(f"OCR ended as {result['status']}: {result.get('provider_error')}")
print(result["extracted_text"])const resp = await fetch("https://api.open-ocr.com/v1/ocr", {
method: "POST",
headers: {
Authorization: "Bearer sk-ocr-your-api-key",
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(), // new UUID per logical request
},
body: JSON.stringify({
engine: "mistral-mistral-ocr-4-1",
input: { type: "url", url: "https://example.com/receipt.png" },
}),
});
const result = await resp.json();
if (result.status !== "succeeded") throw new Error("OCR ended as " + (result.status ?? result.error?.code)); // error envelopes have no status
console.log(result.extracted_text);For dashboard-style usage history (with pagination and date filters), useGET /api/usage.Use Authorization header auth.Passing api_keyas a query parameter is supported only as a deprecated fallback.
# Preferred — the API key alone identifies the caller
curl "https://open-ocr.com/api/usage?page=1&per_page=50" -H "Authorization: Bearer sk-ocr-your-api-key"
# Deprecated fallback (migration only; avoid in new clients)
# curl "https://open-ocr.com/api/usage?api_key=sk-ocr-your-api-key"Migration note: move existing clients from query auth to header auth to avoid leaking API keys in URLs, logs, analytics referrers, and browser history.
OpenOCR offers multiple OCR engines, each optimized for different use cases. See our engine catalog or read the comparison tool to find the best fit.
# List available engines
curl https://api.open-ocr.com/v1/engines \
-H "Authorization: Bearer YOUR_API_KEY"
# Quick guide:
# mistral-mistral-ocr-4-1 — Recommended default: general documents, scans, tables
# google-gemini-3.1-flash-lite — Cheapest acceptable quality
# local-tesseract — OpenOCR-hosted, clean printed text
# local-easyocr — OpenOCR-hosted, multi-language
# local-doctr — OpenOCR-hosted, complex layouts
# openocr-ocrmypdf — OpenOCR-hosted, scanned PDFs with auto-deskew
# openocr-rapidocr — OpenOCR-hosted, lightweightAPI responses include rate limit headers:
X-RateLimit-Limit: 60 # requests per minute
X-RateLimit-Remaining: 59 # requests left in window
X-RateLimit-Reset: 60 # seconds until window resetsDefault limit is 60 requests/minute per API key. If you hit the limit, you'll receive a 429 response.