Skip to main content

Extract text from base64 documents

POST 

/api/v2/Ocr/base64

Runs OCR over the provided documents and returns a provider-agnostic result per file. The model can be selected by model id or by model code + vendor. A failure on one file is reported as a per-file error and does not abort the others.

Request

Query Parameters

    culture string

    Use this param to override the culture of the response. Options: - en (default) - es

Body

The OCR request with the base64 documents, the model selection and optional instructions.

    base64Files

    object[]

    nullable

    Base64-encoded documents, each with its explicit MIME type.

  • Array [

  • contentBase64 stringrequired

    Possible values: non-empty

    The base64-encoded content of the file (raw base64, without a data URI prefix).

    mimeType stringrequired

    Possible values: non-empty

    The MIME type of the file (e.g. "image/png", "application/pdf").

    fileName stringnullable

    Optional original file name, used for logging/labeling.

  • ]

  • instructions stringnullable

    Possible values: <= 4000 characters

    Optional instructions guiding the extraction. If not provided, the system will attempt to extract all text from the documents.

    userIdentifier stringnullable

    Possible values: <= 256 characters

    Optional user identifier for tracking and cost management purposes.

    channel stringnullable

    Possible values: <= 64 characters

    The channel used in the execution.

    aiModelId uuidnullable

    The unique identifier of the AI model to use. Used instead of Vendor and ModelCode.

    modelCode stringnullable

    The model code to use. Used together with Vendor when AIModelId is not provided.

    vendor stringnullable

    The vendor of the model to use. Used together with ModelCode when AIModelId is not provided.

Responses

Returns the OCR result per file, plus the execution instance id and cost.

Schema

    instanceId uuid

    files

    object[]

    nullable

  • Array [

  • index int32
    source stringnullable
    success boolean

    result

    object

    model stringnullable
    provider stringnullable

    pages

    object[]

    nullable

  • Array [

  • index int32required
    markdown stringnullablerequired

    images

    object[]

    nullable

  • Array [

  • id stringnullablerequired
    base64 stringnullable

    boundingBox

    object

    Bounding box in coordinates normalised 0-1 relative to the page.

    x double
    y double
    width double
    height double
  • ]

  • tables

    object[]

    nullable

  • Array [

  • content stringnullablerequired
    format int32

    Possible values: [0, 1]

    The table content format. 0 = Html, 1 = Markdown.

    boundingBox

    object

    Bounding box in coordinates normalised 0-1 relative to the page.

    x double
    y double
    width double
    height double
  • ]

  • hyperlinks

    object[]

    nullable

  • Array [

  • url stringnullablerequired
    text stringnullable

    boundingBox

    object

    Bounding box in coordinates normalised 0-1 relative to the page.

    x double
    y double
    width double
    height double
  • ]

  • header stringnullable
    footer stringnullable

    dimensions

    object

    width int32
    height int32
    dpi int32nullable

    confidence

    object

    averagePageScore doublenullable
    minimumPageScore doublenullable

    wordScores

    object[]

    nullable

  • Array [

  • word stringnullable
    score double
  • ]

  • blocks

    object[]

    nullable

  • Array [

  • label stringnullable

    boundingBox

    object

    Bounding box in coordinates normalised 0-1 relative to the page.

    x double
    y double
    width double
    height double
  • ]

  • ]

  • usage

    object

    inputTokenCount int64nullable
    outputTokenCount int64nullable
    totalTokenCount int64nullable
    cachedInputTokenCount int64nullable
    reasoningTokenCount int64nullable

    additionalCounts

    object

    nullable

    property name* int64
    markdown stringnullable
    error stringnullable
  • ]

  • tokenUsage

    object

    promptTokens int32
    completionTokens int32
    totalTokens int32

    cost

    object

    amount double
    currency stringnullable
Loading...