Vision
Send images to a BlazeInfer model that accepts image input.
Five BlazeInfer models accept images: deepseek-ai/deepseek-v4.1-flash,
google/gemma-4-31b-it, google/gemma-4-26b-a4b-it, qwen/qwen3.8-27b and
qwen/qwen3.5-9b. Send an
image in the same messages array as text, using the OpenAI image_url content
part.
This example reads photo.png from the current folder and sends it as a data
URI:
import base64, os
from openai import OpenAI
client = OpenAI(
base_url="https://blaze.e2enetworks.net/v1",
api_key=os.environ["BLAZE_API_KEY"],
)
with open("photo.png", "rb") as f:
image_b64 = base64.b64encode(f.read()).decode()
response = client.chat.completions.create(
model="google/gemma-4-31b-it",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Describe this image in one line."},
{
"type": "image_url",
"image_url": {"url": f"data:image/png;base64,{image_b64}"},
},
],
}
],
max_tokens=256,
)
print(response.choices[0].message.content)You can also put a public image URL in url instead of a data URI.
Sending an image to a model marked No in the Vision column returns
400 "The upstream provider rejected the request.".
Coding agents can send screenshots and images without asking you, so declare image input for each model in the agent's config. Each agent page shows how: see OpenCode, Kilo Code and Pi.