Skip to content

OCR — Text from Image

Extracts text from an image. Ideal for invoices, documents, ID cards, screenshots.

Available models

ModelNote
spook-ocr (recommended)Turkish + English, printed + handwriting

Two paths

New: /v1/vision/ocr (preferred)

v2.0.0 alias. OpenAI-shaped — SDK-friendly.

New alias path (v2.0.0+)

bash
curl https://app.qevron.ai/v1/vision/ocr \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "spook-ocr",
    "image": "data:image/jpeg;base64,...",
    "language": "en"
  }'

Legacy (custom_test — still works)

bash
curl https://app.qevron.ai/api/channel/87/custom_test \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "spook-ocr",
    "image": "data:image/jpeg;base64,..."
  }'

Channel id (87) can change via the admin panel. Prefer the alias path — no need to pin a channel id in your code.

Python

python
import base64, requests

with open("invoice.jpg", "rb") as f:
    b64 = base64.b64encode(f.read()).decode()

resp = requests.post(
    "https://app.qevron.ai/v1/vision/ocr",
    headers={"Authorization": "Bearer sk-..."},
    json={
        "model": "spook-ocr",
        "image": f"data:image/jpeg;base64,{b64}",
        "language": "en",
    },
)
data = resp.json()
print(data)

Response shape

Today the upstream response passes through verbatim. A v2.0.0-minor will normalize to:

json
{
  "text": "All text from the image, concatenated.",
  "blocks": [
    {"text": "Heading", "bbox": [x, y, w, h], "confidence": 0.98},
    {"text": "Body line", "bbox": [...], "confidence": 0.95}
  ]
}

Tips

  • Higher resolution (1280+ px) improves accuracy.
  • For skewed images, run spook-background first to clean up, then OCR.
  • language is optional but recommended — prevents drift on ambiguous chars (I, 1, l).

Troubleshooting

  • Empty text → image too low resolution or too blurry. Below 1024 px is hard.
  • Wrong chars (l ↔ 1, O ↔ 0) → pass language. Turkish content → tr, English → en.
  • What about PDFs? → convert PDF to per-page JPGs first (pdfium, pdf2image), then send each page. Or use the PDF parsing endpoint.

Next: Object detection · VQA — visual Q&A

Qevron — AI gateway. Arpanet / OpenAI / Anthropic / Gemini compatible.