Images
Models marked for images on the Models page, 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 imagesSend an image
Use the standard OpenAI image_url content part, with an https link or a base64 data URL.
python
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
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
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.

