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

# Send images to a model

> Show vision models PNG and JPEG images in evaluations and training.

In training and evaluation, vision models can read images in chat completion messages.
The `input_modalities` field in those model catalogs describes model-level capability; it
does not guarantee that a trained checkpoint accepts images in deployment chat. Checkpoint
deployments currently accept text only; requests with image parts return HTTP 400. See
[deployments](https://docs.trajectory.ai/guides/deployments.md).
Your harness can show the model a screenshot, chart, or photo in a user message or a tool
result. Evaluations score those trajectories, and training learns from them like any other
turn.

For fixed-choice image classification, see [image decisions](https://docs.trajectory.ai/guides/decision-training.md#image-decisions).
That endpoint accepts image parts in `input`, rather than chat `messages`; check the
decision API and installed SDK support before reusing a chat example.

## Choose a vision model

A model reads images when its `input_modalities` includes `"image"`:

```python theme={null}
from trajectory import Client

client = Client()
for model in client.evals.list_models().items:
    if "image" in model.input_modalities:
        print(model.base_model_slug)
```

`client.training.list_models()` reports the same field for training models. Vision models
include the Qwen 3.5, 3.6, and 3.8 models, Inkling, and the hosted GPT, Claude, Gemini,
and Kimi baselines. A request with an image for a text-only model returns 400
`Model does not accept image inputs.`

## Add an image to a message

Build an image part with `ImageInput` and put it in the message's `content` list, next to
any text parts:

```python harness.py theme={null}
from trajectory import Client
from trajectory.lib import ImageInput

client = Client()
tid = client.trajectories.create().tid
response = client.chat.completions.create(
    model="policy",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "What is the total on this receipt?"},
                ImageInput.from_path("receipt.png").part(),
            ],
        }
    ],
    x_trajectory_id=tid,
)
```

`part()` returns the OpenAI image part with the image as a base64 data URL:

```json theme={null}
{"type": "image_url", "image_url": {"url": "data:image/png;base64,iVBORw0KGgo..."}}
```

Harnesses that call the OpenAI client directly can send the same part. The API also
accepts the `input_image` type and a plain string `image_url`. It ignores `detail`.

Images may appear in `user` and `tool` messages. To return a screenshot from a tool, put
the image part in the tool message's `content` list with its `tool_call_id`. Images in
`system`, `developer`, or `assistant` messages return 400.

### Upload large or repeated images

Inline images travel in the request body, which is capped at 32 MiB, about 24 MiB of
images after base64 encoding. A conversation also resends earlier images on every turn.
For large images, or ones the model sees on many turns, attach the image to the trajectory
once and send a part that names it:

```python theme={null}
image = ImageInput.from_path("page.png").upload(client, tid)
# {"type": "image", "artifact_id": "..."}
```

The returned part works only in requests for that trajectory. Uploads use the
[artifact upload](https://docs.trajectory.ai/guides/diagnostic-artifacts.md) flow, so the image is also kept with the
trajectory.

## Formats and limits

| Limit | Value |
| - | - |
| Formats | PNG or JPEG, a single frame. The data URL's media type must match the bytes. |
| Source | Base64 `data:` URLs or uploaded artifacts. Remote `https://` image URLs are not fetched. |
| One image | 16 MiB and 50,331,648 pixels. |
| One request | 64 MiB of images, counting a repeated image each time it appears. |
| Aspect ratio | Qwen models accept at most 200:1. |

The platform resizes each image to fit the model before the model reads it, keeping its
aspect ratio. Qwen models read at most 16,777,216 pixels, with sides rounded to multiples
of 32. Inkling reads a long side of at most 4,096 pixels. The resized copy applies EXIF
rotation, converts colors to sRGB, and places transparent areas on white. Images that
already fit pass through unchanged.

Image tokens count as input tokens. Fewer pixels cost fewer tokens, so set the
`image_max_pixels` run option to downscale images further:

```python theme={null}
run = client.evals.create(
    bench_id="YOUR_BENCHMARK_ID",
    base_model_slug="Qwen/Qwen3.6-35B-A3B",
    options={"image_max_pixels": 1_048_576},
)
```

`image_max_pixels` accepts 1 to 16,777,216 and can only lower the model's own limit. A
training run's checkpoints keep its value in later evaluations and deployments unless
you set it again. Retaining the value does not enable image input for checkpoint deployment
chat, which currently accepts text only.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.