Skip to navigation

Create Ocr Document

Upload a base64-encoded PDF or image and start OCR. The returned document_id is the only public identifier: it works with this OCR endpoint and every /documents/{document_id} endpoint.

Choose Standard, Enhanced, or Handwriting OCR with mode (defaults to standard). PDFs and images up to 20 MB (before base64 encoding) are supported. PDF pages are counted server-side and images count as one page. Prices are 0.025,0.025, 0.125, and $0.25 per page respectively, matching the purchased-credit rates. The estimated API balance charge is reserved before OCR starts; only successfully extracted pages are charged, and the unused reservation is released. Poll GET /v1/ocr/{document_id} for progress and page HTML.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
filestringRequired

Base64-encoded PDF or image bytes.

file_namestringRequired
Original file name including extension.
content_typestringRequired

Supported MIME type (application/pdf, image/bmp, image/gif, image/jpeg, image/png, image/tiff, or image/webp). Images count as one page; encrypted PDFs are unsupported.

modeenumOptional

OCR type. Defaults to standard ($0.025/page). Enhanced costs $0.125/page; Handwriting costs $0.25/page and does not include image-to-text highlighting. Only successfully extracted pages are charged.

Allowed values:
titlestringOptional
Display title. Defaults to the file name without its extension.
folder_idUUIDOptional
Optional owned document folder. Null or omitted creates the OCR document at root.

Response

This endpoint returns an object.
document_idUUID
Stable OCR document ID. There is no separate public OCR job ID.
statusstring
Initial OCR status, normally PENDING.
num_pagesinteger

Number of pages counted server-side and reserved for billing.

estimated_api_cost_centsdouble
API balance amount reserved for the estimated page count.

Errors

400
OCR Invalid File
401
Authentication Error
402
Insufficient API Balance
404
Folder Not Found
413
OCR File Too Large
503
OCR Pricing Not Configured