v1

latestOpenAPI 3.1.0Apache 2.02026-07-264001921002.3 KB
Async Jobs

Create async OCR job

Submits an OCR request for asynchronous execution. Returns a job ID immediately with HTTP 202. Poll the corresponding GET endpoint with the job ID to retrieve the result.

post/v1/async/ocr

Headers

x-bf-async-job-result-ttlinteger

Time-to-live in seconds for the job result after completion. Defaults to 3600 (1 hour). After expiry, the job result is automatically cleaned up.

Request body

modelstring required

Model in provider/model format

idstring

Optional unique identifier for the request

fallbacksstring[]

Fallback models in provider/model format

include_image_base64boolean

Whether to include base64-encoded images in the response

pagesinteger[]

Specific page indices to process (0-based)

image_limitinteger

Maximum number of images to extract per page

image_min_sizeinteger

Minimum image size in pixels to extract

table_formatstring

Format for extracted tables (e.g., "markdown", "html")

extract_headerboolean

Whether to extract page headers

extract_footerboolean

Whether to extract page footers

confidence_scores_granularity'page' | 'block' | 'word' | 'document'

Granularity of confidence scores to include in the response

document_annotation_promptstring

Custom prompt for document annotation

Example request

{
  "model": "mistral/mistral-ocr-latest"
}

Response

Job accepted for processing

idstring required

Unique identifier for the async job

status'pending' | 'processing' | 'completed' | 'failed' required

The status of an async job

expires_atstring date-time

When the job result expires and will be cleaned up

created_atstring date-time required

When the job was created

completed_atstring date-time

When the job completed (successfully or with failure)

status_codeinteger

HTTP status code of the completed operation

{"stackTrail":"components:schemas:AsyncJobResponse:properties:result","oasType":"schema","type":"unknown","description":"The result of the completed operation (shape depends on the request type)"}