> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vlm.run/llms.txt
> Use this file to discover all available pages before exploring further.

# paddleocr/pp-ocrv6

> Scene-text OCR and document Markdown from PaddleOCR.

Scene-text OCR (PP-OCRv6 detection + recognition). Accepts up to **8 images** or a
`document_url` PDF; no text-only input. Default method: `ocr`.

## Output by method

| Method   | Payload kind | Image `content.object`    | Payload                                                             |
| -------- | ------------ | ------------------------- | ------------------------------------------------------------------- |
| `ocr`    | json         | `pp_ocrv6.ocr.regions`    | Region items with `bbox_xywh`, optional `poly_xy`, `text`, `score`  |
| `detect` | json         | `pp_ocrv6.detect.regions` | Region items with `bbox_xywh` and optional `poly_xy`, geometry only |
| `text`   | markdown     | none                      | Recognized text stitched in reading order                           |

The payload kind is the same for an image and for each page of a PDF. Text mode
emits the payload alone for one image, one `<image>` block per image for several,
and one `<document>` / `<page>` block per PDF. In JSON mode an image `content` is
the tagged container above, and a document page `content` is always
`document.page.blocks`. See [Methods & Response Format](/gateway/methods).

Coordinates are normalized 0-1 against the image or rasterized page, at
`precision` decimals (default 4).

* `ocr`: full detection + recognition. `method_params.lang` selects the recognition
  language (`en`, `ch`, `japan`, ...); optional `method_params.score_threshold`
  filters low-confidence lines. (default)
* `detect`: text detection only. Boxes and polygons without recognized text.
* `text`: the recognized lines stitched into one string per image or page. It is
  plain scene text, not generative Markdown.

## Request

<CodeGroup>
  ```python Python [expandable] theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  from openai import OpenAI

  client = OpenAI(
      base_url="https://gateway.vlm.run/v1/openai",
      api_key="<VLMRUN_API_KEY>",
  )

  response = client.chat.completions.create(
      model="paddleocr/pp-ocrv6",
      messages=[
          {
              "role": "user",
              "content": [
                  {
                      "type": "image_url",
                      "image_url": {
                          "url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/document.receipt/playground/2.jpg"
                      },
                  },
              ],
          }
      ],
      extra_body={"method": "ocr"},
  )

  print(response.choices[0].message.content)
  ```

  ```bash cURL [expandable] theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  curl https://gateway.vlm.run/v1/openai/chat/completions \
    -X POST \
    -H "Authorization: Bearer $VLMRUN_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "paddleocr/pp-ocrv6",
      "method": "ocr",
      "messages": [
        {
          "role": "user",
          "content": [
            {
              "type": "image_url",
              "image_url": {
                "url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/document.receipt/playground/2.jpg"
              }
            }
          ]
        }
      ]
    }'
  ```
</CodeGroup>

## Response

<Tabs>
  <Tab title="Text mode">
    A single image returns the region container alone, with no wrapper:

    ```json theme={"theme":{"light":"github-light","dark":"dark-plus"}}
    {"object": "pp_ocrv6.ocr.regions", "items": [{"bbox_xywh": [0.0332, 0.0138, 0.1719, 0.0331], "poly_xy": [[0.0332, 0.0138], [0.2051, 0.0138], [0.2051, 0.047], [0.0332, 0.047]], "text": "Invoice", "score": 0.998}, {"bbox_xywh": [0.0332, 0.0829, 0.2598, 0.0331], "text": "Total: $99.00", "score": 0.987}]}
    ```
  </Tab>

  <Tab title="JSON mode">
    One image entry; `content` is the region container:

    ```json theme={"theme":{"light":"github-light","dark":"dark-plus"}}
    {
      "model": "paddleocr/pp-ocrv6",
      "method": "ocr",
      "data": [
        {
          "object": "image",
          "image_hash": "sha256:...",
          "image_width": 1024,
          "image_height": 1448,
          "content": {
            "object": "pp_ocrv6.ocr.regions",
            "items": [
              {"bbox_xywh": [0.0332, 0.0138, 0.1719, 0.0331], "poly_xy": [[0.0332, 0.0138], [0.2051, 0.0138], [0.2051, 0.047], [0.0332, 0.047]], "text": "Invoice", "score": 0.998},
              {"bbox_xywh": [0.0332, 0.0829, 0.2598, 0.0331], "poly_xy": [[0.0332, 0.0829], [0.293, 0.0829], [0.293, 0.116], [0.0332, 0.116]], "text": "Total: $99.00", "score": 0.987}
            ]
          }
        }
      ]
    }
    ```
  </Tab>
</Tabs>

For PDFs, each page's `content` is `document.page.blocks`, and every region
becomes one block with the same geometry under a zero-based `index`. See the
[Document OCR guide](/gateway/guides/document-ocr#4-parse-the-response).
