For the complete documentation index, see llms.txt. This page is also available as Markdown.

Modèles OCR

Aide pour intégrer manuellement les Modèles OCR : référence de l'API, client de test et exemples cURL.

Send a file for an ocr utility inference.

post

Send a file to the asynchronous processing queue for an ocr utility inference.

Results can be retrieved in two ways:

  • Loop on the polling_url endpoint in the response until the status is Processed or Failed (polling).

  • Use a webhook to be notified when the inference is finished. Webhooks can be configured on the platform on a per-model basis.

Inferences taking longer than 590 seconds will time out.

Autorisations
AuthorizationstringRequis
Réponses
202

Successful Response

application/json

Response for a Job.

post/v2/products/ocr/enqueue

Get the status of a file's processing.

get

Get the status of an inference that was previously enqueued.

If you are using webhooks there is no need to call this route.

When the job status is Processing or Failed the return code will be HTTP 200.

When the job status is Processed the return code will be HTTP 302.

The processing result can then be retrieved in two ways:

  • Recommended: Using a GET on the URL specified in the result_url field of the response

  • Allowing your client to redirect on the Location header of the response

Note: set the redirect parameter to false to disable the redirection behavior, and always return HTTP 200.

Autorisations
AuthorizationstringRequis
Paramètres de chemin
job_idstring · uuid4Requis

UUID of the job to retrieve

Paramètres de requête
redirectbooleanOptionnel

Automatically redirect to the result URL

Default: true
Réponses
200

Successful Response

application/json

Response for a Job.

get/v2/jobs/{job_id}

Get the result of a completed ocr product inference.

get

Get the result of an ocr utility inference that was previously enqueued.

Important: always prefer using the value returned in job.result_url, rather than calling this endpoint directly.

The inference will only be available after it has finished processing.

If you are using webhooks there is no need to call this route. However, the JSON payload described here is what will be sent to each specified webhook's URL.

If you activated the "Delete extracted data when fetched" option for the model, the inference will be deleted after this route completes. Any further requests to the same inference ID will return a 404.

Autorisations
AuthorizationstringRequis
Paramètres de chemin
inference_idstring · uuid4Requis

UUID of the inference to retrieve

Corps

Form to enqueue an inference for utility models.

model_idstring · uuid4Requis

Model ID to use for the inference.

filestring · nullableOptionnel

Upload a file as bytes. Required if url is not provided.

urlstring · uri · min: 1 · max: 2048 · nullableOptionnel

Download the file from a URL, must be secure (HTTPS) and publicly available. Required if file is not provided.

file_base64string · min: 15 · nullableOptionnel

Upload a file as a base 64 string. Used as an alternative to file. Not recommended, for specific use only.

Example: Base64String==
webhook_idsstring · uuid4[]Optionnel

Webhook IDs to call after all processing is finished. If empty, no webhooks will be used. Can be a list or comma-separated string.

filenamestring · nullableOptionnel

Optional filename to associate with the uploaded or fetched file.

aliasstring · nullableOptionnel

Optional: a free-form string to tag the request with your own identifier. For example, an internal document ID, reference number, or database key. If set, it will be included in the job and result responses.

Example: my_file_alias
Réponses
200

Successful Response

application/json

Response for an ocr utility inference.

get/v2/products/ocr/results/{inference_id}

Ocr Utility Processed

When an OCR utility inference is processed, this payload is sent to the specified webhooks.

Webhooks are specified in the webhooks_ids parameter when enqueuing an OCR utility inference.

Charge utile

Response for an ocr utility inference.

Réponses
200

Successful Response

application/json
anyOptionnel

Payload

Mis à jour

Ce contenu vous a-t-il été utile ?