Beyond Text
Many useful apps start with a picture: a photo of a flyer to turn into a calendar entry, a scanned form to read, a chart to explain. Others end with one: an illustration for a lesson or a graphic for an event page. On Gloo, both use the same Responses request you’ve been using: add an image to theinput to have a model read it, or pick an image-capable model to have it draw one.
Core Concepts
Images In: Vision
A model that can read images is called a vision model. You send the image as part of a user message, next to your text:{"type": "input_text", "text": "..."}for the words{"type": "input_image", "image_url": "..."}for the picture
data: URI. (Base64 is a way of writing a file’s bytes as plain text so it fits inside JSON.)
Not every model can read images. In the model catalog, supports_vision is true and input_modalities includes image for those that can.
Images Out: Generation
Image-capable models return a picture as animage_generation_call item in output[]. Its result field holds the image as a base64 string, which your code decodes and saves.
There are two ways to get one:
- Call an image model directly, such as
gloo-google-gemini-3-pro-image. You can add optionalimage_generationsettings (quality,size), which are passed to providers that support them. - Give a GPT-5 or GPT-6 model that supports it the
image_generationtool (see Models that can use the tool). OpenAI’s image generation runs as a tool, so the model decides when to draw and can combine the image with text in the same response. Include aninput_imagein the conversation and the tool edits that image instead of starting fresh.
What It Costs
Responses requests are billed per token at the model’s rates. A Gloo image model is billed at its catalog rates. Images drawn by theimage_generation tool are billed at the rates OpenAI publishes for the image model that drew them, and only for images that come back. See How image generation is billed.
Get Started
Read an Image
Python
data: URI:
Generate an Image
output[]:
image_generation_call item, alongside any text from the model.
Good to Know
- Use the Responses shape for images. Vision and image generation are first-class on the Responses endpoints. Direct Responses and the guarded Responses endpoint take the same request.
- Look through every output item. A response can hold text, reasoning and image items together. Pick out what you need by
type. gpt-image-2isn’t a top-levelmodel. On Gloo, as on OpenAI’s own API, it’s set inside theimage_generationtool. The request’smodelis a GPT-5 or GPT-6 model.- Save what you’ll need again. The image comes back in the response as base64. Decode it and store the file if your app will show it later.
- Describe what you want to see. Image prompts work best with concrete details: subject, style, setting, colors and mood.
Key Takeaway
Images use the same Responses request as text. To read one, add aninput_image and pick a model with supports_vision. To create one, call an image model or give a GPT-5 or GPT-6 model the image_generation tool, then decode the base64 result.
Learn more
- Direct Responses: Multimodal: image input, image generation and image editing
- Using the Guarded Responses API: a step-by-step vision example
- Supported Models: which models read and generate images
What’s next
Next, you’ll suggest relevant books, articles and videos from your own content.Lesson 7: Recommendations
Ranked items from your own publishers or Gloo’s publisher network.

