Skip to content
Get API key API key

Image input

AI Foundation Services provides vision models that can analyze images alongside text. Use the same Chat Completions API with image content.

What you’ll learn:

  • How to analyze images from URLs
  • How to send local images via base64 encoding
  • How to find out which models accept images
Terminal
curl -X POST "$OPENAI_BASE_URL/chat/completions" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "Qwen3.6-35B-A3B-FP8",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "What is in this image?"},
{"type": "image_url", "image_url": {"url": "https://images.unsplash.com/photo-1546069901-ba9599a7e63c?w=400"}}
]
}
],
"max_tokens": 1024
}'

You can also pass a local image as a base64-encoded string:

Python
import base64
from openai import OpenAI
client = OpenAI()
def encode_image(image_path):
with open(image_path, "rb") as f:
return base64.b64encode(f.read()).decode("utf-8")
base64_image = encode_image("/path/to/your/image.jpg")
response = client.chat.completions.create(
model="Qwen3.6-35B-A3B-FP8",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "What's in this image?"},
{
"type": "image_url",
"image_url": {"url": f"data:image/jpeg;base64,{base64_image}"},
},
],
}
],
max_tokens=1000,
)
print(response.choices[0].message.content)
Model (example)ProviderCapabilities
Qwen3.6-35B-A3B-FP8T Cloud, Germany (EU)Text and image input
gemma-4-31B-it-FP8T Cloud, Germany (EU)Text and image input

For scanned pages and handwriting, use the two OCR models.