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

# Send images and video

> Send images and MP4 video to vision-capable Serverless Inference models and get text responses.

Serverless Inference accepts images and text together in the same request. You can ask a model to describe a photo, extract information from a screenshot, or interpret a chart. Some models also accept MP4 clips. The model returns a text response. To see the available Serverless Inference models, go to **Models** in the [Forge UI](https://forge.coreweave.com/inference/models) and add a filter for vision features (image or video).

Requests use the OpenAI-compatible [Chat Completions API](https://docs.coreweave.com/products/inference/serverless/api-reference/chat-completions.md). Use the API model ID in the `model` field.

## Models that accept images

The following models accept PNG, JPG, and WebP images. Each model accepts an image through an HTTPS URL or a Base64 data URL:

| Model | API model ID |
| - | - |
| DeepSeek V4.1-Flash-1017 | `deepseek-ai/DeepSeek-V4.1-Flash-1017` |
| DeepSeek V4.1-Flash | `deepseek-ai/DeepSeek-V4.1-Flash` |
| Google Gemma 4 31B | `google/gemma-4-31B-it` |
| Google Gemma 4 26B A4B Instruct | `google/gemma-4-26B-A4B-it` |
| MiniMax M3 | `MiniMaxAI/MiniMax-M3` |
| Moonshot AI Kimi K2.7 Code | `moonshotai/Kimi-K2.7-Code` |
| Moonshot AI Kimi K2.6 | `moonshotai/Kimi-K2.6` |
| NVIDIA Nemotron 3.5 Super VL | `nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B` |
| Qwen3.8 27B | `Qwen/Qwen3.8-27B` |
| Qwen3.6 35B A3B | `Qwen/Qwen3.6-35B-A3B` |
| Z.AI GLM 5.3 Flash | `zai-org/GLM-5.3-Flash` |

## Prerequisites

Install the `openai` Python package and set your Forge API key as an environment variable. Replace `[API-KEY]` with your API key:

```bash theme={"system"}
export FORGE_API_KEY="[API-KEY]"
```

The examples on this page use Python and the `openai` package, but neither is required. Any HTTP client works, such as `curl`. To send the same requests from the command line, convert the examples to `curl` requests to the Chat Completions endpoint.

## Send an image

To ask a question about an image, send a `text` part with your question and an `image_url` part in the same `user` message.

* For a hosted image, use a directly reachable HTTPS URL.
* For a local image, Base64-encode the file and include the MIME type in the data URL, as in `data:image/png;base64,[ENCODED-IMAGE]`.

The following example sends a hosted PNG. To send a local PNG instead, uncomment the two lines that encode the file and set the file path. Change the question to suit your image.

```python theme={"system"}
import base64
import os
from pathlib import Path

from openai import OpenAI

client = OpenAI(
    base_url="https://api.inference.wandb.ai/v1",
    api_key=os.environ["FORGE_API_KEY"],
)

image_url = "https://openai-documentation.vercel.app/images/cat_and_otter.png"
# For a local PNG, uncomment these two lines and set the file path.
# encoded = base64.b64encode(Path("image.png").read_bytes()).decode("ascii")
# image_url = f"data:image/png;base64,{encoded}"

response = client.chat.completions.create(
    model="google/gemma-4-31B-it",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "What animals are shown?"},
                {"type": "image_url", "image_url": {"url": image_url}},
            ],
        }
    ],
)

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

The script prints the model's text answer about the image.

### Try an image in the Playground

To ask a question about an image without writing code, open the [Playground](https://forge.coreweave.com/inference/playground) and do the following:

1. Select a model that accepts image input.
2. In the attachment menu, choose **Add image** or **Add image URL**.

For more information about using the Playground, see [Try models in the Playground UI](https://docs.coreweave.com/products/inference/serverless/ui-guide.md#playground).

## Models that accept video

The following table lists the models that accept H.264 MP4 video. Each model accepts video through an HTTPS URL or a Base64 data URL:

| Model | API model ID |
| - | - |
| Google Gemma 4 31B | `google/gemma-4-31B-it` |
| Google Gemma 4 26B A4B Instruct | `google/gemma-4-26B-A4B-it` |
| MiniMax M3 | `MiniMaxAI/MiniMax-M3` |
| Moonshot AI Kimi K2.7 Code | `moonshotai/Kimi-K2.7-Code` |
| Moonshot AI Kimi K2.6 | `moonshotai/Kimi-K2.6` |
| NVIDIA Nemotron 3.5 Super VL | `nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B` |
| Qwen3.8 27B | `Qwen/Qwen3.8-27B` |
| Qwen3.6 35B A3B | `Qwen/Qwen3.6-35B-A3B` |
| Z.AI GLM 5.3 Flash | `zai-org/GLM-5.3-Flash` |

## Send a video

To ask a question about a video, send a `text` part with your question and a `video_url` part in the same `user` message.

* For a hosted video, use a directly reachable HTTPS URL.
* For a local video, Base64-encode the file and include the MIME type in the data URL, as in `data:video/mp4;base64,[ENCODED-VIDEO]`.

The following example sends a hosted MP4. To send a local H.264 MP4 instead, uncomment the two lines that encode the file and set the file path. Change the question to suit your video.

```python theme={"system"}
import base64
import os
from pathlib import Path

from openai import OpenAI

client = OpenAI(
    base_url="https://api.inference.wandb.ai/v1",
    api_key=os.environ["FORGE_API_KEY"],
)

video_url = "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
# To use a local H.264 MP4, uncomment these two lines and set the file path.
# encoded = base64.b64encode(Path("clip.mp4").read_bytes()).decode("ascii")
# video_url = f"data:video/mp4;base64,{encoded}"

response = client.chat.completions.create(
    model="zai-org/GLM-5.3-Flash",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "How does the scene change over time?"},
                {"type": "video_url", "video_url": {"url": video_url}},
            ],
        }
    ],
    max_tokens=1024,
)

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

The script prints the model's text description of the video.
