Dynamiq
A I Gateway

Parse a document with OCR

Extracts the text of a PDF or image as Markdown using an LLM-based OCR pipeline. The `options` form field is a JSON string selecting the LLM. With `"stream": true` the response is an SSE stream of extraction events instead of JSON.

POST
/v1/ocr/parse

Authorization

AuthorizationBearer <token>

Organization or project Access Key created in the Dynamiq console. Used for deployed-app (Runs API), AI Gateway, traces collector, and management API requests. Send as Authorization: Bearer <access-key>.

In: header

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/ocr/parse" \  -F file="string" \  -F options="string"
{
  "data": {
    "text": "# Invoice 4812\n\n| Item | Amount |\n| --- | --- |\n| Pro plan (June) | $49.00 |\n| Pro plan (June) | $49.00 |"
  }
}
{
  "error": {
    "code": "bad_request",
    "message": "Bad Request",
    "details": {
      "input": "cannot be blank"
    }
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Unauthorized"
  }
}
{
  "error": {
    "code": "bad_request",
    "message": "Failed to parse data",
    "details": {
      "error": "1 validation error for LLMRequest"
    }
  }
}