---
title: "Create async OCR job"
method: POST
path: "/v1/async/ocr"
tags: ["Async Jobs"]
---

# Create async OCR job

`POST /v1/async/ocr`

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.

## Headers

- `x-bf-async-job-result-ttl` integer

## Request body

- OCRRequest
  - `model` string, required — Model in provider/model format
  - `id` string — Optional unique identifier for the request
  - `document` union, required
    - object
      - `type` 'document_url', required — Type of document input: - `document_url`: A PDF URL or base64 data URL - `image_url`: An image URL
      - `document_url` string, required — URL or base64 data URL of the document (required when type is document_url)
      - `image_url` string — URL of the image to process (required when type is image_url)
    - object
      - `type` 'image_url', required — Type of document input: - `document_url`: A PDF URL or base64 data URL - `image_url`: An image URL
      - `document_url` string — URL or base64 data URL of the document (required when type is document_url)
      - `image_url` string, required — URL of the image to process (required when type is image_url)
  - `fallbacks` string[] — Fallback models in provider/model format
  - `include_image_base64` boolean — Whether to include base64-encoded images in the response
  - `pages` integer[] — Specific page indices to process (0-based)
  - `image_limit` integer — Maximum number of images to extract per page
  - `image_min_size` integer — Minimum image size in pixels to extract
  - `table_format` string — Format for extracted tables (e.g., "markdown", "html")
  - `extract_header` boolean — Whether to extract page headers
  - `extract_footer` boolean — Whether to extract page footers
  - `confidence_scores_granularity` 'page' | 'block' | 'word' | 'document' — Granularity of confidence scores to include in the response
  - `bbox_annotation_format` union — Format for bounding box annotations. Supports text, json_object, and json_schema modes.
    - object
      - `type` 'text' | 'json_object', required — The format type
      - `json_schema` object — JSON schema definition (required when type is json_schema)
        - `schema` object — The JSON schema
        - `name` string — Name of the schema
        - `strict` boolean — Whether to enforce strict validation
    - object
      - `type` 'json_schema', required — The format type
      - `json_schema` object, required — JSON schema definition (required when type is json_schema)
        - `schema` object — The JSON schema
        - `name` string — Name of the schema
        - `strict` boolean — Whether to enforce strict validation
  - `document_annotation_format` union — Format for document-level annotations. Supports text, json_object, and json_schema modes.
    - object
      - `type` 'text' | 'json_object', required — The format type
      - `json_schema` object — JSON schema definition (required when type is json_schema)
        - `schema` object — The JSON schema
        - `name` string — Name of the schema
        - `strict` boolean — Whether to enforce strict validation
    - object
      - `type` 'json_schema', required — The format type
      - `json_schema` object, required — JSON schema definition (required when type is json_schema)
        - `schema` object — The JSON schema
        - `name` string — Name of the schema
        - `strict` boolean — Whether to enforce strict validation
  - `document_annotation_prompt` string — Custom prompt for document annotation

## Response `202`

Job accepted for processing

- AsyncJobResponse — Response returned when creating or polling an async job
  - `id` string, required — Unique identifier for the async job
  - `status` 'pending' | 'processing' | 'completed' | 'failed', required — The status of an async job
  - `expires_at` string, date-time — When the job result expires and will be cleaned up
  - `created_at` string, date-time, required — When the job was created
  - `completed_at` string, date-time — When the job completed (successfully or with failure)
  - `status_code` integer — HTTP status code of the completed operation
  - `result` unknown
  - `error` BifrostError — Error response from Bifrost
    - `event_id` string
    - `type` string
    - `is_bifrost_error` boolean
    - `status_code` integer
    - `error` ErrorField
      - `type` string
      - `code` string
      - `message` string
      - `param` string
      - `event_id` string
    - `extra_fields` BifrostErrorExtraFields
      - `provider` 'openai' | 'azure' | 'anthropic' | 'bedrock' | 'cohere' | 'vertex' | 'vllm' | 'mistral' | 'ollama' | 'groq' | 'sgl' | 'parasail' | 'perplexity' | 'replicate' | 'cerebras' | 'deepseek' | 'gemini' | 'openrouter' | 'elevenlabs' | 'huggingface' | 'nebius' | 'xai' | 'runway' | 'fireworks' — AI model provider identifier
      - `model_requested` string
      - `request_type` string

## Other responses

- `400` — Bad request
- `500` — Internal server error

---

[API](https://skmtc.net/getbifrost/apis/bifrost-api.md) · [All operations](https://skmtc.net/getbifrost/apis/bifrost-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getbifrost/bifrost-api/revisions/f8cab88f64ea/schema)
