IronStratum

POST /v1/ocr

OCR a document (unit-billed, pages)

Specialty route (route_type: ocr). multipart/form-data forwarded byte-identical, untouched (no re-multipart, no model swap; the boundary is preserved). Accepted form fields — file (at least one part; each image part is one page, a single-shot PDF is one part), model (required), mode (print | archival — must match the alias's lane), diplomatic (t | f, the archival fidelity flag), language; unknown fields are 400 unknown_param. Upload cap 25 MiB (413) — the ONE cap shared with the transcriptions family; over-cap payloads are the client's to chunk into page-range jobs. Response: the model's JSON verbatim. Metering: unit_type='pages' = the model-reported pages count, else the file-part count (media records the basis); priced per 1000 pages. Idempotency-Key: accepted, no replay semantics (§8 route-scope, the multipart family law).

Request

The body is multipart/form-data — one part per field below; the sample sends it with curl -F legs (curl owns the boundary — no Content-Type header).

Request body fields for ocrDocument
Field Type Required Description
file array of string (binary) yes The page images (or one single-shot PDF), ≤ 25 MiB total.
model string yes An IronStratum alias whose route_type is ocr.
mode string enum no Must match the model's lane — a consistency check, not a router.
diplomatic string enum no —
language string no —

Responses

400 400

400 response fields for ocrDocument
Field Type Required Description
error object yes —

401 401

401 response fields for ocrDocument
Field Type Required Description
error object yes —

402 402

402 response fields for ocrDocument
Field Type Required Description
error object yes —

403 403

403 response fields for ocrDocument
Field Type Required Description
error object yes —

404 404

404 response fields for ocrDocument
Field Type Required Description
error object yes —

413 413

413 response fields for ocrDocument
Field Type Required Description
error object yes —

500 500

500 response fields for ocrDocument
Field Type Required Description
error object yes —

502 502

502 response fields for ocrDocument
Field Type Required Description
error object yes —

503 503

503 response fields for ocrDocument
Field Type Required Description
error object yes —

Status codes

  • 200 — The OCR response verbatim (text, per-page results, pages).

Example

curl -X POST https://api.ironstratum.com/v1/ocr \
  -H "Authorization: Bearer $IRONSTRATUM_API_KEY" \
  -F file=@<file>
  -F model=<model>

All operations · interactive reference · openapi.yaml