Skip to content

An error response has a JSON body:

{
"error": {
"code": "insufficient_credits",
"message": "Account has 5 credits available, this request requires at least 30 reserved.",
"details": { "balance": 5, "required_reserve": 30 }
}
}

code is stable and meant for programs; message is for people and may change. details appears only for some codes.

StatusCodeMeaningWhat to do
400invalid_requestMissing file, wrong Content-Type, or an invalid field value; details.field names it (and details.allowed lists valid ocr_model ids).Fix the request.
401invalid_api_keyMissing, malformed, revoked or unknown key, or a suspended account.Check the key (Authentication).
402insufficient_creditsNot enough available credits for the reservation; details has balance and required_reserve.Add credits, or wait for conversions in progress to finish.
404not_foundNo such endpoint.Check the path.
405method_not_allowedWrong HTTP method for the endpoint.Check the method.
413file_too_largeFile over 50 MB, a PDF over 20 MB that needs OCR, or a part inside the file too large.Split or shrink the file.
415unsupported_formatNot HTML, DOCX, PDF, PPTX or XLSX.Convert the file to a supported format first.
422page_limit_exceededOver 500 PDF pages, 200 slides or 50 sheets.Split the document.
422image_limit_exceededMore than 50 pictures to OCR in an HTML, DOCX, PPTX or XLSX file.Split the file or send ocr=off.
422parse_failedThe file is damaged or password-protected, has no slides, or contains no text that could be extracted.Check the file; do not retry unchanged.
429too_many_concurrentToo many conversions in progress for this key.Retry after the Retry-After header (Rate limits).
500internal_errorUnexpected failure.Retry later.
502ocr_provider_errorThe document has no text left because OCR failed or was unavailable.Retry later, or choose another ocr_model.
503service_unavailableTemporary failure.Retry with backoff; see below when details.request_id is present.

No credits are charged for a request that returns an error: the reservation is released immediately.

The one exception is a 503 service_unavailable with details.request_id. It means the charge could not be confirmed and may have been recorded. Before retrying, look for that request_id in GET /v1/wallet/transactions: if a convert transaction has it, the conversion was charged (the Markdown is lost; converting again charges again).

A response that is not JSON (for example an HTML error page from the network edge) should be treated like a 5xx and retried later. A reservation left by an interrupted request expires after 5 minutes and is then released automatically.