Skip to main content
Infercom provides access to vision-capable models on our EU sovereign infrastructure, allowing you to process both text and images with full data sovereignty. These models analyze images and generate context-aware text responses.

Supported models

gemma-4-31B-it runs on Infercom’s sovereign infrastructure in Germany. Your image data never leaves the EU.

Make a query with an image

On Infercom, the vision model request follows OpenAI’s multimodal input format which accepts both text and image inputs in a structured payload. While the call is similar to Text Generation, it differs by including an encoded image file, referenced via the image_path variable. A helper function is used to convert this image into a base64 string, allowing it to be passed alongside the text in the request.
1

Step 1

Make a new Python file and copy the code below.
This example uses gemma-4-31B-it, Google’s vision-capable Gemma 4 model hosted on Infercom’s EU sovereign infrastructure.
2

Step 2

Use your Infercom API key from the API keys and URLs page to replace the placeholder "your-infercom-api-key" in the construction of the client.
3

Step 3

Select an image and move it to a suitable path that you can specify in the lines.
4

Step 4

Verify the prompt to pair with the image in the content portion of the user prompt.
5

Step 5

Run the Python file to receive the text output.

Tools and structured output with images

Vision requests support the same tools, tool_choice and response_format options as text-only requests. The constraint is applied during generation, so a forced tool call or a strict JSON schema is honoured on a request that carries an image.
See Function calling and JSON mode for the full tool-calling workflow.

Errors

Malformed image data

If the API cannot decode your image, it returns HTTP 400. This is a permanent error. Do not retry it. Check that the base64 string is complete and that the MIME type in the data: URL matches the file.
This response does not use the standard error envelope. The error field is a string, not an object, and there is no request_id. A client that reads error.message gets undefined here.
See API error codes for the standard envelope and the two paths that do not use it.

Image tokens count towards the context limit

Images consume prompt tokens. A large image plus a long prompt can exceed the model’s 128K context limit and return a context_length_exceeded error. Check usage.prompt_tokens in the response to see how many tokens an image costs.