Visual language model support for custom models - Extend the Create Custom Model API with multimodal configuration to connect custom-hosted visual language model (VLM) endpoints to Document Automation for image and document-based data extraction.

Automation 360

Extend the Create Custom Model API with multimodal configuration to connect custom-hosted visual language model (VLM) endpoints to Document Automation for image and document-based data extraction.

Overview

Model connections support multimodal input—images and PDFs—for seeded models such as Anthropic Claude and Google Gemini. Document Automation extends this support to custom-hosted VLM endpoints that can also process images and documents but previously could not be configured for multimodal input.

To enable multimodal support for a custom model, you extend the standard Create Custom Model API payload with the following additions:

  • MULTIMODAL_REQUEST: An annotation on the variable that identifies where file data enters the request body.
  • multimodal_config: An object that describes how the file data should be structured for your specific VLM vendor schema.

For the base JSON payload structure, required parameters, and authentication options, see Create Custom model API.

multimodalFiles variable

The MULTIMODAL_REQUEST annotation indicates to the Document Automation extraction engine where in the request body to inject file data and stores the multimodal configuration for the vendor schema.

{
  "path": "$.messages[0].content[1].*",
  "attribute": {
    "name": "multimodal_files",
    "value": { "type": "TEXT" },
    "annotations": ["MULTIMODAL_REQUEST"]
  },
  "multimodal_config": {
    "fileTypes": ["png", "jpg", "jpeg", "gif", "webp"],
    "mediaTypes": ["image"],
    "maxFiles": -1,
    "maxSizeAllFiles": "7 MB",
    "file": [ ... ],
    "fields": [ ... ]
  }
}
Important:

The path value (also referred to as dslPath) is the JSONPath location in the request body where the first uploaded file is placed. The Document Automation extraction engine increments the array index automatically for each additional file. For example, with path: "$.messages[0].content[1].*", the first file goes to content[1], the second to content[2], and so on. content[0] is typically reserved for the text prompt.

Parameter Type Required Description
path String Yes The JSONPath location in the request body where file data is injected. Use the ${multimodalFiles.path} placeholder in fields entries to reference this path at runtime.
attribute.name String Yes The internal name of the variable. Use multimodal_files.
attribute.annotations Array Yes Must include MULTIMODAL_REQUEST to activate multimodal processing for this variable.
multimodal_config Object Yes Describes the supported file types, limits, and how file data maps to the vendor's request schema.

multimodal_config object

The multimodal_config object defines the file types accepted by the VLM endpoint and how file data is structured in the request body. It extends the standard file-type metadata with optional properties that eliminate the need for hardcoded vendor-specific mappers.

Property Type Required Description
fileTypes Array Yes List of accepted file extensions (for example, ["png", "jpg", "pdf"]).
mediaTypes Array No High-level media categories the model supports. Supported values: "image", "document". Use ["image", "document"] when the model accepts both. Required when using options.
maxFiles Integer Yes Maximum number of files allowed per request. Use -1 for unlimited, or 1 for single-file endpoints.
maxSizeAllFiles String Yes Maximum combined file size (for example, "7 MB").
file Array No Extension-to-format mappings. Required when the API expects a format name that differs from the file extension (for example, jpg must be sent as jpeg). Each entry has an extension and a format value.
fields Array Conditional Defines how file data maps into the request body when all file types follow the same request structure. Use this property when the vendor treats images and documents identically. Cannot be used together with options.
options Object Conditional Defines per-category field mappings when different file types require different request structures (for example, when images and PDFs use separate request schemas). Each key is a media category (such as image or document) with its own file and fields definitions. Cannot be used together with fields.
Note:

If neither fields nor options is provided, the system defaults to the legacy OpenAI-style mapping. Existing custom models remain unaffected.

fields array

Each entry in fields specifies a target location in the request body and the value to place there for each uploaded file.

Property Type Required Description
path String Yes The JSONPath in the request body where the value is placed. Use ${multimodalFiles.path} as a placeholder; at runtime it resolves to the correct array position for each file based on the dslPath and the file's index. Append field suffixes after the placeholder (for example, ${multimodalFiles.path}.inlineData.mimeType).
value String Yes What to place at the path. Uppercase tokens (such as MIME_TYPE or BASE64_DATA) are resolved dynamically at runtime from the uploaded file's data. Any other string is inserted as a static literal. Token matching is case-sensitive: MIME_TYPE resolves dynamically, but mime_type is a static literal. See #da-custom-model-vlm__section_tokens.
rules Object No Optional post-processing rules applied after the value is resolved. See #da-custom-model-vlm__section_rules.

Dynamic tokens

Use the following tokens as the value in a fields entry. Tokens are resolved at runtime from the uploaded file's data URI. Token matching is case-sensitive; any value that does not exactly match a token name is treated as a static literal.

Token Resolves to When to use Example output
MIME_TYPE The MIME type extracted from the file's data URI. When the API requires a separate MIME type field alongside the file data. image/png, application/pdf
BASE64_DATA The raw base64-encoded file content (the portion after base64, in the data URI). When the API expects only the base64 string without the data:...;base64, prefix. Most APIs use this token. iVBORw0KGgo...
DATA_URI The complete data URI string, including the MIME prefix and encoding marker. When the API expects the full data URI (for example, OpenAI's image_url.url field). data:image/png;base64,iVBOR...
FILE_EXTENSION The file extension derived from the MIME type using an internal mapping. Note: image/jpeg resolves to jpeg, not jpg. When the API needs the raw extension string. png, jpeg, pdf
FILE_FORMAT The canonical format name from the file mapping in the config. This is the format value that corresponds to the matched extension. When the API expects a format name that differs from the extension. For example, a .jpg file can be mapped to format jpeg via {"extension": "jpg", "format": "jpeg"}. jpeg (for a .jpg file)
FILE_NAME An auto-generated name based on the file's position: file_1 for the first file, file_2 for the second, and so on. When the API requires a file name but the original name is not available (for example, Amazon Bedrock's document.name). file_1, file_2
FILE_CATEGORY The key name of the matched category from the options map. Only relevant when using options. Useful when the API requires the media category as a field value. image, document

Rules

Each fields entry can optionally include a rules object to post-process the resolved value. Rules are applied in the order listed below. All rule properties are optional; include only those needed.

Property Type Description
prefix String Prepends a string to the resolved value. Supports ${TOKEN} interpolation (for example, "data:${MIME_TYPE};base64,").
suffix String Appends a string to the resolved value. Also supports ${TOKEN} interpolation.
trim Boolean Strips leading and trailing whitespace from the resolved value.

The following example constructs a complete data URI from a raw base64 string by prepending the MIME type and encoding marker:

{
  "path": "${multimodalFiles.path}.image_url.url",
  "value": "BASE64_DATA",
  "rules": {
    "prefix": "data:${MIME_TYPE};base64,"
  }
}

Configuration examples

The following examples show the complete multimodalFiles variable definition for common VLM vendor schemas. Add this variable in your Create Custom Model API payload.

Amazon Bedrock

When images and PDFs require different request structures, use options instead of top-level fields. Each key in options defines its own file mappings and fields. The uploaded file's extension is matched against the mappings in each option to determine which category applies.

{
  "path": "$.messages[0].content[1].*",
  "attribute": {
    "name": "multimodal_files",
    "value": { "type": "TEXT" },
    "annotations": ["MULTIMODAL_REQUEST"]
  },
  "multimodal_config": {
    "fileTypes": ["png", "jpg", "jpeg", "gif", "webp", "pdf"],
    "mediaTypes": ["image", "document"],
    "maxFiles": -1,
    "maxSizeAllFiles": "7 MB",
    "options": {
      "image": {
        "file": [
          { "extension": "png",  "format": "png"  },
          { "extension": "jpg",  "format": "jpeg" },
          { "extension": "gif",  "format": "gif"  },
          { "extension": "webp", "format": "webp" }
        ],
        "fields": [
          { "path": "${multimodalFiles.path}.image.format",       "value": "FILE_FORMAT"  },
          { "path": "${multimodalFiles.path}.image.source.bytes", "value": "BASE64_DATA"  }
        ]
      },
      "document": {
        "file": [
          { "extension": "pdf", "format": "pdf" }
        ],
        "fields": [
          { "path": "${multimodalFiles.path}.document.name",         "value": "FILE_NAME"   },
          { "path": "${multimodalFiles.path}.document.format",       "value": "FILE_FORMAT" },
          { "path": "${multimodalFiles.path}.document.source.bytes", "value": "BASE64_DATA" }
        ]
      }
    }
  }
}

Gemini

All file types use the same request structure. The file array maps extensions to their canonical format names.

{
  "path": "$.contents[0].parts[1].*",
  "attribute": {
    "name": "multimodal_files",
    "value": { "type": "TEXT" },
    "annotations": ["MULTIMODAL_REQUEST"]
  },
  "multimodal_config": {
    "fileTypes": ["png", "jpg", "jpeg", "gif", "webp"],
    "mediaTypes": ["image"],
    "maxFiles": -1,
    "maxSizeAllFiles": "7 MB",
    "file": [
      { "extension": "png",  "format": "png"  },
      { "extension": "jpg",  "format": "jpeg" },
      { "extension": "gif",  "format": "gif"  },
      { "extension": "webp", "format": "webp" }
    ],
    "fields": [
      { "path": "${multimodalFiles.path}.inlineData.mimeType", "value": "MIME_TYPE"   },
      { "path": "${multimodalFiles.path}.inlineData.data",     "value": "BASE64_DATA" }
    ]
  }
}

With path: "$.contents[0].parts[1].*", uploading two images produces the following paths in the request body:

Generated path Value
$.contents[0].parts[1].inlineData.mimeType MIME type of first image
$.contents[0].parts[1].inlineData.data Base64 content of first image
$.contents[0].parts[2].inlineData.mimeType MIME type of second image
$.contents[0].parts[2].inlineData.data Base64 content of second image

GPT-5 (Azure OpenAI)

This endpoint accepts the full data URI, but instead of the DATA_URI token, the request builds the value from the raw base64 string using a prefix rule that interpolates MIME_TYPE. The fileTypes list also includes tiff.

{
  "path": "$.messages[0].content[1].*",
  "attribute": {
    "name": "multimodal_files",
    "value": { "type": "TEXT" },
    "annotations": ["MULTIMODAL_REQUEST"]
  },
  "multimodal_config": {
    "fileTypes": ["png", "jpg", "jpeg", "gif", "webp", "tiff"],
    "mediaTypes": ["image"],
    "maxFiles": -1,
    "maxSizeAllFiles": "7 MB",
    "file": [
      { "extension": "png",  "format": "png"  },
      { "extension": "jpg",  "format": "jpeg" },
      { "extension": "tiff", "format": "tiff" }
    ],
    "fields": [
      { "path": "${multimodalFiles.path}.type", "value": "image_url" },
      {
        "path": "${multimodalFiles.path}.image_url.url",
        "value": "BASE64_DATA",
        "rules": { "prefix": "data:${MIME_TYPE};base64," }
      }
    ]
  }
}

OpenAI-compatible/Qwen

The "image_url" value is not an uppercase token, so it is inserted as a static literal. The full data URI is placed in image_url.url.

{
  "path": "$.messages[0].content[1].*",
  "attribute": {
    "name": "multimodal_files",
    "value": { "type": "TEXT" },
    "annotations": ["MULTIMODAL_REQUEST"]
  },
  "multimodal_config": {
    "fileTypes": ["png", "jpg", "jpeg", "gif", "webp"],
    "mediaTypes": ["image"],
    "maxFiles": -1,
    "maxSizeAllFiles": "7 MB",
    "file": [
      { "extension": "png", "format": "png"  },
      { "extension": "jpg", "format": "jpeg" }
    ],
    "fields": [
      { "path": "${multimodalFiles.path}.type",          "value": "image_url" },
      { "path": "${multimodalFiles.path}.image_url.url", "value": "DATA_URI"  }
    ]
  }
}

HuggingFace (single file)

For endpoints that accept a single file at a fixed path, set maxFiles: 1 and use the fixed path directly in fields without the ${multimodalFiles.path} placeholder.

{
  "path": "$.inputs.image",
  "attribute": {
    "name": "multimodal_files",
    "value": { "type": "TEXT" },
    "annotations": ["MULTIMODAL_REQUEST"]
  },
  "multimodal_config": {
    "fileTypes": ["png", "jpg", "jpeg"],
    "mediaTypes": ["image"],
    "maxFiles": 1,
    "maxSizeAllFiles": "5 MB",
    "file": [
      { "extension": "png", "format": "png"  },
      { "extension": "jpg", "format": "jpeg" }
    ],
    "fields": [
      { "path": "$.inputs.image", "value": "DATA_URI" }
    ]
  }
}