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

# Sending files to models

> Which models accept files, images, PDFs, and audio through the AI Gateway, how to shape each content part, and when to send a URL or base64.

**Use Cases**

* Choosing a model that can read the file type being sent.
* Sending an image or a document in a model request without uploading it first.
* Deciding between a public URL and base64 for a given provider.

***

This page covers which models accept files and how to shape the request. Complete examples per modality, plus image generation and audio, are owned by [Image, PDF, and audio: multimodal inputs and generation](/ai-gateway/features/multimodal).

Files reach a model **inline**, as a content part in the request. There is no upload step: pass a public URL or a base64 data URI, and the **AI Gateway** converts it to the shape the target provider expects.

Two things trip up most first requests:

* **Image support and PDF support are separate capabilities.** A model that reads images very often cannot read a PDF.
* **Images and documents use different content parts**, with different required fields.

<Note>
  Looking to store a document for reuse across knowledge bases or batch jobs? That is the [Files API](/ai-studio/ai-engineering/files), a separate system. Files uploaded there cannot be referenced by ID in a model request.
</Note>

## Which models accept what

Of the models in the **AI Gateway** catalog, image input, PDF input, and audio input have meaningfully different acceptance rates — and the sets are not nested: **image support does not imply PDF support.**

| Model                                                 | Image | PDF | Audio |
| ----------------------------------------------------- | :---: | :-: | :---: |
| `openai/gpt-5.6-sol`                                  |   ✓   |  ✓  |   ✗   |
| `openai/gpt-5.4-mini`                                 |   ✓   |  ✓  |   ✗   |
| `anthropic/claude-opus-5`                             |   ✓   |  ✓  |   ✗   |
| `anthropic/claude-sonnet-5`                           |   ✓   |  ✓  |   ✗   |
| `google/gemini-3.7-flash`                             |   ✓   |  ✓  |   ✓   |
| `google/gemini-3.1-pro-preview`                       |   ✓   |  ✓  |   ✓   |
| `xai/grok-4.6`                                        |   ✓   |  ✗  |   ✗   |
| `mistral/mistral-medium-3.5`                          |   ✓   |  ✗  |   ✗   |
| `alibaba/qwen3.6-27b`                                 |   ✓   |  ✗  |   ✓   |
| `google/meta/llama-4-maverick-17b-128e-instruct-maas` |   ✓   |  ✗  |   ✗   |
| `aws/us.amazon.nova-2-lite-v1:0`                      |   ✓   |  ✗  |   ✗   |

<Warning>
  **"Vision model" does not imply "reads PDFs".** Whole families accept images without accepting PDFs, including Mistral (Pixtral, Magistral, Ministral, Mistral Medium), Llama 3.2 and Llama 4, Qwen 3.5 and 3.6, Grok 4.5 and 4.6, and Amazon Nova. Capability also varies **within** a family, so check the specific model rather than the family.
</Warning>

The modality tabs on the [Models page](/ai-gateway/using-the-router) filter by model *type* (chat, image generation, embedding), not by accepted input. For a model that is not in the table above, check the provider's documentation before sending a PDF.

## Sending an image vs sending a document

Images and documents are different content parts. The table shows the shape; for complete runnable examples in each language, see [Image, PDF, and audio: multimodal inputs and generation](/ai-gateway/features/multimodal).

|                       | Image                 | Document     |
| --------------------- | --------------------- | ------------ |
| Responses API type    | `input_image`         | `input_file` |
| Chat Completions type | `image_url`           | `file`       |
| Payload field         | `image_url`           | `file_data`  |
| `filename`            | not used              | **required** |
| `detail`              | `low`, `high`, `auto` | not used     |

<CodeGroup>
  ```json JSON (Responses API) theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "role": "user",
    "content": [
      { "type": "input_text", "text": "Compare these." },
      { "type": "input_image", "image_url": "https://example.com/chart.png", "detail": "high" },
      { "type": "input_file", "filename": "report.pdf", "file_data": "data:application/pdf;base64,<base64-data>" }
    ]
  }
  ```

  ```json JSON (Chat Completions) theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "role": "user",
    "content": [
      { "type": "text", "text": "Compare these." },
      { "type": "image_url", "image_url": { "url": "https://example.com/chart.png", "detail": "high" } },
      { "type": "file", "file": { "filename": "report.pdf", "file_data": "data:application/pdf;base64,<base64-data>" } }
    ]
  }
  ```
</CodeGroup>

`input_file` is not PDF-only. Anthropic models also accept CSV, plain text, JSON, Markdown, XML, and RTF as documents, and AWS Bedrock additionally accepts DOC, DOCX, XLS, XLSX, and HTML. Set `filename` with the correct extension so the type is detected. Bedrock rewrites document names to alphanumerics, spaces, hyphens, and brackets, truncated to 64 characters.

## URL or base64?

A base64 data URI works with every provider and is the safest default. Public URLs are handled differently upstream, and the **AI Gateway** absorbs most of the difference: when a provider cannot fetch a URL itself, the gateway downloads the file and inlines it before forwarding the request.

| Provider           | Image URL                          | Document URL                       |
| ------------------ | ---------------------------------- | ---------------------------------- |
| OpenAI             | Native                             | Not forwarded: send base64         |
| Anthropic          | Native                             | Native                             |
| AWS Bedrock        | Fetched and inlined by the gateway | Base64 only                        |
| Google AI (Gemini) | Fetched and inlined by the gateway | Fetched and inlined by the gateway |
| Vertex AI          | Native, including `gs://`          | Native, including `gs://`          |

Two provider behaviours are worth knowing:

**Gemini handles files natively, and the gateway uses that.** A `fileUri` from the Gemini Files API is passed straight through rather than downloaded. Base64 content larger than 4 MB is uploaded to the Gemini Files API automatically and sent as a `fileUri`, which keeps large documents out of the request body. Only arbitrary public URLs are fetched and inlined, because Gemini rejects unknown URIs with `Invalid or unsupported file uri`. On Vertex AI, `gs://` and public URLs are both resolved server side and pass through untouched.

**A document `file_url` does not reach OpenAI.** On the message path the gateway forwards `file_data`, `file_id`, and `filename`, so a PDF supplied as `file_url` arrives with no source and is ignored. Send the document as a base64 data URI in `file_data`, or reference an OpenAI `file_id`.

Use base64 when the file is not reachable from the public internet, when the URL requires authentication, or when byte-identical input is needed across a fallback chain. Use a URL to keep request bodies small and to benefit from provider-side caching.

<Warning>
  A content part a provider cannot accept may be **dropped rather than rejected**: the request succeeds, and the model answers without ever having seen the file. If a response ignores the attachment, confirm the model accepts that input type and that the transport is supported before debugging the prompt.
</Warning>

## Related

* [Image, PDF, and audio: multimodal inputs and generation](/ai-gateway/features/multimodal), full examples for image, PDF, and audio, plus image generation and speech
* [Files API](/ai-studio/ai-engineering/files), upload and manage stored documents in **AI Studio**
* [Supported Models](/ai-gateway/supported-models), the model catalog by endpoint
* [Run Agents: Attach Files](/ai-studio/ai-engineering/run-agents#attach-files), sending files to a managed agent
