> ## 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.

# Quickstart

> Prerequisites and first requests for VQA and document OCR

Point `base_url` at `https://gateway.vlm.run/v1/openai` in any OpenAI SDK and
you can start making requests. This page covers setup and the two most
common request shapes: visual Q\&A and document OCR. See
[Introduction](/gateway/introduction) for the rationale behind the VLM Run Gateway.

## Prerequisites

<CodeGroup>
  ```bash Python theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  pip install openai
  ```

  ```bash Node.js theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  npm install openai
  ```
</CodeGroup>

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
export VLMRUN_API_KEY="your-api-key"
```

<Note>
  Base URL: `https://gateway.vlm.run/v1/openai`. Use
  `Authorization: Bearer <VLMRUN_API_KEY>`, or omit the header for anonymous
  access. See [Authentication](/gateway/authentication) and
  [Rate Limits](/gateway/rate-limits).
</Note>

<h2 id="visual-qa">
  Visual Q\&A
</h2>

Send a question with an optional image. See
[Models](/gateway/models#visual-question-answering-vqa) for available models.

<CodeGroup>
  ```python Python 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="qwen/qwen3.5-0.8b",
      messages=[
          {
              "role": "user",
              "content": [
                  {"type": "text", "text": "What is happening in this image?"},
                  {
                      "type": "image_url",
                      "image_url": {
                          "url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.generation/sf-golden-gate.jpg",
                      },
                  },
              ],
          }
      ],
  )

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

  ```bash cURL 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": "qwen/qwen3.5-0.8b",
      "messages": [
        {
          "role": "user",
          "content": [
            { "type": "text", "text": "What is happening in this image?" },
            {
              "type": "image_url",
              "image_url": {
                "url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.generation/sf-golden-gate.jpg"
              }
            }
          ]
        }
      ]
    }'
  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  import OpenAI from "openai";

  const client = new OpenAI({
    baseURL: "https://gateway.vlm.run/v1/openai",
    apiKey: process.env.VLMRUN_API_KEY,
  });

  const response = await client.chat.completions.create({
    model: "qwen/qwen3.5-0.8b",
    messages: [
      {
        role: "user",
        content: [
          { type: "text", text: "What is happening in this image?" },
          {
            type: "image_url",
            image_url: {
              url: "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.generation/sf-golden-gate.jpg",
            },
          },
        ],
      },
    ],
  });

  console.log(response.choices[0].message.content);
  ```
</CodeGroup>

<h2 id="document-and-image-ocr">
  Document and Image OCR
</h2>

Pass a PDF as a `document_url` content part and select a per-page method. See
[Models](/gateway/models#document-and-image-ocr) and
[Flexible Document OCR](/gateway/guides/document-ocr) for the full pipeline.

<CodeGroup>
  ```python Python 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": "document_url",
                      "document_url": {
                          "url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/document.markdown/goog-10-k-2024.pdf"
                      },
                  }
              ],
          }
      ],
      extra_body={
          "method": "ocr",
          "document_dpi": 150,
      },
  )

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

  ```bash cURL 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",
      "document_dpi": 150,
      "messages": [
        {
          "role": "user",
          "content": [
            {
              "type": "document_url",
              "document_url": {
                "url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/document.markdown/goog-10-k-2024.pdf"
              }
            }
          ]
        }
      ]
    }'
  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  import OpenAI from "openai";

  const client = new OpenAI({
    baseURL: "https://gateway.vlm.run/v1/openai",
    apiKey: process.env.VLMRUN_API_KEY,
  });

  const response = await client.chat.completions.create({
    model: "paddleocr/pp-ocrv6",
    messages: [
      {
        role: "user",
        content: [
          {
            type: "document_url",
            document_url: {
              url: "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/document.markdown/goog-10-k-2024.pdf",
            },
          },
        ],
      },
    ],
    method: "ocr",
    document_dpi: 150,
  });

  console.log(response.choices[0].message.content);
  ```
</CodeGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Flexible Document OCR" icon="file-lines" href="/gateway/guides/document-ocr">
    Request knobs, page blocks, and streaming for PDFs.
  </Card>

  <Card title="Models" icon="table-list" href="/gateway/models">
    Catalog, capabilities, and model selection.
  </Card>

  <Card title="Authentication" icon="key" href="/gateway/authentication">
    Anonymous vs API key access and rate limits.
  </Card>

  <Card title="Chat Completions API" icon="code" href="/gateway/api-reference/post-chat-completions">
    Full request parameters and response schema.
  </Card>
</CardGroup>
