# Vision
Source: https://docs.getworg.com/vision
Send images as image_url parts in a user message, next to your text. The model reads them as input tokens.
## Lanes
- `deepseek-v4.1-flash:cached`: up to 8 images per request
- `deepseek-v4.1-flash:standard`: up to 8 images per request
`qwen3.8-27b:standard` may accept an image, but misread text and tables in Worg's tests, so it is not listed for vision. Do not rely on it.
## Send an image
Python:
```
import base64
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.getworg.com/v1",
api_key=os.environ["WORG_API_KEY"],
)
with open("receipt.png", "rb") as f:
image = base64.b64encode(f.read()).decode()
response = client.chat.completions.create(
model="deepseek-v4.1-flash:cached",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "What is the total on this receipt? Reply with the amount only."},
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image}"}},
],
}],
reasoning_effort="none",
max_tokens=100,
)
print(response.choices[0].message.content)
```
An image can also be a public URL:
Content part:
```
{"type": "image_url", "image_url": {"url": "https://example.com/receipt.png"}}
```
## Rules
- Up to 8 images per request. More gets `400 invalid_request`.
- A URL must be `https` or `http` to a public host name. IP addresses, `localhost`, `.local` and `.internal` hosts are refused, and so is a `data:` URL that is not `data:image/`.
- The model's server downloads the URL itself. Hosts that refuse automated downloads make the request fail. For files on your own systems, send a data URI.
- Keep images at 2,048 px on the longest side or less. A lane that refuses an image as too large answers `413 images_too_large`; through a combo, the next lane is tried first.
- `detail` in `image_url` is accepted and has no effect on the tokens.
## Tokens and cost
Images count inside `prompt_tokens`. On the DeepSeek V4.1 Flash lanes, Worg's tests measured about 200 tokens for a 384 px image, 652 for 1,024 × 1,024 px, and at most about 1,000 for larger images.
Before a request is sent, the [cost hold](https://docs.getworg.com/rate-limits#hold) counts each image at the most one image can cost on that lane, because the size of an image behind a URL is not known in advance.
Next: [Chat requests](https://docs.getworg.com/chat-completions) · [Rate limits](https://docs.getworg.com/rate-limits)
View as Markdown
Vision
Send images as image_url parts in a user message, next to your text. The model reads them as input tokens.
Lanes
deepseek-v4.1-flash:cached: up to 8 images per requestdeepseek-v4.1-flash:standard: up to 8 images per request
qwen3.8-27b:standard may accept an image, but misread text and tables in Worg's tests, so it is not listed for vision. Do not rely on it.
Send an image
Python
import base64
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.getworg.com/v1",
api_key=os.environ["WORG_API_KEY"],
)
with open("receipt.png", "rb") as f:
image = base64.b64encode(f.read()).decode()
response = client.chat.completions.create(
model="deepseek-v4.1-flash:cached",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "What is the total on this receipt? Reply with the amount only."},
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image}"}},
],
}],
reasoning_effort="none",
max_tokens=100,
)
print(response.choices[0].message.content)An image can also be a public URL:
Content part
{"type": "image_url", "image_url": {"url": "https://example.com/receipt.png"}}Rules
- Up to 8 images per request. More gets
400 invalid_request. - A URL must be
httpsorhttpto a public host name. IP addresses,localhost,.localand.internalhosts are refused, and so is adata:URL that is notdata:image/. - The model's server downloads the URL itself. Hosts that refuse automated downloads make the request fail. For files on your own systems, send a data URI.
- Keep images at 2,048 px on the longest side or less. A lane that refuses an image as too large answers
413 images_too_large; through a combo, the next lane is tried first. detailinimage_urlis accepted and has no effect on the tokens.
Tokens and cost
Images count inside prompt_tokens. On the DeepSeek V4.1 Flash lanes, Worg's tests measured about 200 tokens for a 384 px image, 652 for 1,024 × 1,024 px, and at most about 1,000 for larger images.
Before a request is sent, the cost hold counts each image at the most one image can cost on that lane, because the size of an image behind a URL is not known in advance.
Next: Chat requestsRate limits