---
url: https://docs.freetheai.org/concepts/images.md
description: >-
  Send pictures to FreeTheAI models that can read images, using OpenAI image_url
  content parts or Anthropic image blocks, as a data URL or an https link.
---

# Images

Models marked for images on the [Models page](https://freetheai.org/models), such as `fta/zai/glm-5.3-flash`, can read pictures you attach. Text-only models refuse them with:

```text
This model accepts text only. Remove the images, or pick a model that accepts images
```

## Send an image

Use the standard OpenAI `image_url` content part, with an https link or a base64 data URL.

::: code-group

```python [Python (link)]
reply = client.chat.completions.create(
    model="fta/zai/glm-5.3-flash",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "What is in this picture?"},
            {"type": "image_url", "image_url": {"url": "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"}},
        ],
    }],
)
print(reply.choices[0].message.content)
```

```python [Python (local file)]
import base64

with open("photo.jpg", "rb") as f:
    data = base64.b64encode(f.read()).decode()

reply = client.chat.completions.create(
    model="fta/zai/glm-5.3-flash",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "Describe this photo in two sentences."},
            {"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{data}"}},
        ],
    }],
)
```

```ts [TypeScript]
import { readFile } from 'node:fs/promises'

const data = (await readFile('photo.jpg')).toString('base64')
const reply = await client.chat.completions.create({
  model: 'fta/zai/glm-5.3-flash',
  messages: [{
    role: 'user',
    content: [
      { type: 'text', text: 'Describe this photo in two sentences.' },
      { type: 'image_url', image_url: { url: `data:image/jpeg;base64,${data}` } },
    ],
  }],
})
```

:::

On Anthropic Messages, use an `image` content block with a `base64` source (`media_type` and `data`), as in the Anthropic API.

## Size

A whole request, images included, can be up to 8 MB. Base64 makes a file about a third larger, so resize big photos first. A request over the limit answers `413` with `request body is too large`; send fewer or smaller images, or shorten the chat history.

The `fta/dog/` models also read images you attach, for questions, descriptions, and writing.
