OCR
POST /v1/ocr is Mistral's OCR endpoint. The model is <provider>/<model>, for
example mistral/mistral-ocr-latest.
1curl https://api.aile.sh/v1/ocr \2-H "Authorization: Bearer $AILE_KEY" \3-H "Content-Type: application/json" \4-d '{5 "model": "mistral/mistral-ocr-latest",6 "document": { "type": "document_url", "document_url": "https://example.com/paper.pdf" },7 "pages": "0-4"8}'
Billing
- One unit per page processed, never more than the hold. An
image_urldocument is one page. pages("0,1,2","0-5"or[0,1,2]) sets the hold. Without it the document is capped to the deployment's page limit (100 by default) and the response carriesx-aile-ocr-page-cap.- A document is an https URL or a data URI, up to 25 MB.
file_idis refused. - A response with no pages is a
502and is not charged. - A provider refusal you can fix (
400,404,413,422…) passes through. One about the lender's account is a502saying you were not charged. A502or504arrives as503with the real code inx-aile-status. - A key's pins and the routing headers choose the lender here too.
x-aile-providermust match the model's prefix, andx-aile-max-pricedoes not apply to a per-page price. - Where the deployment enables keyless x402, OCR takes it for an image, or a document with
pages.