Skip to main content
Two request fields decide what a VLM Run Gateway model returns:
  • method selects what the model computes (ocr, detect, parse_layout, chat, …).
  • response_format selects how that result is serialized (a text rendering, or a JSON object).
They are orthogonal: any method combines with any format, and the two renderings carry the same information. This page is the canonical reference for both. For copy-pasteable per-model examples, see Models.

The method field

Most models expose one or more method values. Pass method (and optional method_params) at the top level of the request body, or via extra_body in the OpenAI Python SDK. If you omit method, the model’s default is applied: markdown on zai-org/glm-ocr and rednote-hilab/dots.mocr, ocr on paddleocr/pp-ocrv6, detect on paddlepaddle/pp-doclayoutv3, caption on microsoft/florence-2-base-ft, and chat on the chat VLMs.
Every model’s live methods, default_method, and extra_body_help are also available on GET /v1/openai/models. A method a model does not advertise is a 400.

The response_format field

response_format mirrors the OpenAI object, so existing clients work unchanged:
A JSON response_format is always served non-streamed: the stream flag is ignored, because a single valid JSON object cannot be assembled from SSE deltas. In text mode, stream: true is honored and the stream is byte-identical to the non-streaming reply: the <document> open tag, then one chunk per <page> block, then the close tag. See Streaming.

The precision field

precision (int, range 1-8, default 4) sets the number of decimal places on normalized coordinates (bbox_xywh / poly_xy / point_xy) and score. It applies to both formats and is ignored for markdown payloads. The response shape is unchanged.

Text mode

A text reply is a sequence of top-level blocks, one per input medium. Each block body is either a json block or a markdown block, and nothing else. Json is the default. A method renders a markdown block only when it emits genuinely free-form text: markdown, chat, caption, text, and rednote-hilab/dots.mocr’s ocr. Which one applies is a property of the (model, method) pair, and it is echoed on the wire as format=. See Methods by model for the mapping.

Document input

Each PDF is one <document> block wrapping one <page> block per rasterized page. Multiple document_url parts yield one <document> block each, never merged.
A failed page is self-closing, with status="error" and no body, so page numbering stays intact. format is the same on every page of a request, and it is emitted on every page.

Single image input

The block alone, with no wrapper:
or, for a markdown-kind method:
This is the one form that carries no image_hash / image_width / image_height. Use JSON mode when you need that metadata.

Multi-image input

Repeated <image> blocks, one per image:
Structured models (OCR, detection, and layout: everything except the chat VLMs) run inference per image and emit one block each, and usage is summed. Chat VLMs reason over all the images together and emit a single block.

Chat VLMs pass through

The chat VLMs (qwen/qwen3.5-0.8b and the rest of the chat family) return their reply verbatim in every case: text, one image, or several. No wrapper, no tags, byte-identical to the model’s own output. They do not accept document_url: a PDF request is a 400 capability error.

JSON mode

With response_format={"type":"json_object"} the reply is always the same envelope. The chat VLMs are the one exemption; see Chat VLMs are not enveloped.
model and method name what produced the payload. Both keys are JSON-mode only. data holds one self-describing entry per input medium. A single image or PDF is a list of one; multiple images or documents (up to the model’s max_images) are a list of many. Clients iterate the same way every time.
object is the input medium: image, video, or document. It says which fields to read; the payload type lives on the content container’s own object. The hash and dimensions are omitted only when the image cannot be decoded.

content per medium

A json payload is never a bare array, and a markdown payload is never wrapped. An image content has exactly one shape per (model, method).

The region record

One entry of an image content.items, that is, what one detector found in one pass. Unset optional keys are omitted. Which keys a given (model, method) emits is fixed, and an unknown key is a validation error, not a silently ignored extra.

The document block record

One entry of document.page.blocks.items. Every key is optional, and a model fills the subset it can, so one type covers every document method. A whole-page read is one block that carries text and no geometry:
A layout read is one block per region:
paddlepaddle/pp-doclayoutv3 numbers reading order from 1 on an image. On the document path that becomes the zero-based index.

Content object tags

On a document page the tag is always document.page.blocks, because the payload is a property of the medium. On an image the tag is <group>.<method>.regions, where the group is the model’s contract family. Aliases resolve first, so pp-ocrv6 and paddleocr/pp-ocrv6 share one contract. A markdown-kind method on an image has no container and therefore no tag.

Chat VLMs are not enveloped

A chat VLM reply is passed through in JSON mode too: the body is the model’s own JSON, with no data wrapper and no object tag.
This is what OpenAI’s response_format={"type":"json_object"} means: the model emits the JSON.

Text and JSON modes carry the same data

A text rendering decodes into exactly the JSON-mode data list: parse the body as JSON when format="json", and take it verbatim when format="markdown". One type therefore validates both renderings, and you can switch formats without a second parser. The single exception is the bare single-image form, which carries no image metadata: decoding recovers content but not image_hash, image_width, or image_height.

Methods by model

Output kind is a function of the model and the method. Default method in bold. Imgs is the maximum images per request, and Doc marks the models that accept document_url PDFs. The kind above is the image kind, which is also the page format in text mode. In JSON mode a document page is always document.page.blocks. paddlepaddle/pp-doclayoutv3 is a layout detector with no OCR path, so detect is its only method.

Method Parameters

method_params is an optional object passed alongside method at the top level of the request body, or via extra_body in the OpenAI Python SDK. Keys are model- and method-specific; the table below lists every key.

Method-specific keys

Models

Per-model dropdowns with request and response examples for every method.

Multimodal Inputs

Content part types and document input limits.

Flexible Document OCR

End-to-end recipe from model selection to response parsing.

Chat Completions

Full request and response schema.