---
title: "Image Generation with AI Agents | Hostman Docs"
description: "Learn how to enable image generation for your AI agent, choose between Gemini and GPT Image models, and let it create illustrations right in the chat."
---

> For the complete documentation index for AI agents, see [llms.txt](https://hostman.com/llms.txt).

The image generation feature lets your agent create images from text descriptions right within the conversation.

The agent automatically detects whether a message is a request to generate an image and routes it to the [selected image model](https://hostman.com/docs/ai-agents/manage-agents/image-generation/#available-models). If the message isn't an image generation request, the agent simply replies with a regular text message.

Image generation works when interacting with the agent through the [external chat](https://hostman.com/docs/ai-agents/manage-agents/external-chat/) or an [embedded widget](https://hostman.com/docs/ai-agents/manage-agents/embed-chatbots/).

Pricing depends on the selected model and is calculated per token. Input tokens (the prompt) and output tokens (the generated image) are billed separately.

## Available Models

When you enable image generation, you can choose from the following models:

-   **Gemini 3.1 Flash Image Preview**: A fast model for generating illustrations, sketches, and drafts. Best when speed matters more than top-tier quality.
    
-   **Gemini 3 Pro Image Preview**: An advanced model with better detail and quality. Suited for production use cases and final illustrations.
    
-   **GPT Image 2**: An advanced model that delivers high detail and closely follows instructions. Ideal for final illustrations and more complex visuals.
    

You can switch models at any time in the agent's settings.

## Enabling and Disabling Image Generation

You can turn image generation on or off either while creating an agent or from an existing agent's settings.

### When Creating an Agent

On the **Pricing** step, enable the **Image Generation** option and select your preferred model.

![Group 1 2026 08 17 12 50](https://content.hostman.com/assets/893627cf-b796-4eac-a54c-e4671171fc82.png?width=742&height=821)

### In an Existing Agent's Settings

1.  Go to **AI Services** → **Agents** and click the agent you want to configure.
    
2.  Open the **Management** tab.
    
3.  Click **Modify** in the **Image Generation** block.
    

![Inventive Umbriel 2026 08 17 12 52](https://content.hostman.com/assets/4a8b7ea4-fdb3-44c8-83ec-e5ec65d7e043.png?width=1581&height=869)

4.  Toggle the option on or off.
    
5.  If enabling it, select an image generation model from the dropdown.
    
6.  Click **Save**.
    

![Inventive Umbriel 2026 08 17 12 52 (1)](https://content.hostman.com/assets/a93e3266-bf1d-4817-98dc-cc76e6a3dcd6.png?width=1754&height=869)
