For the complete documentation index, see llms.txt. This page is also available as Markdown.

Image Generation

Let an agent generate images on demand using OpenAI, xAI, or Gemini image generation

Image Generation lets your agent create images from text prompts during a conversation or workflow run.

What it does

This tool lets an agent call a native create_image function. Fetch Hive executes the function server-side against the image generation service, which avoids remote MCP timeout limits for long-running image jobs. The API used depends on the agent's primary provider:

  • OpenAI agents — routes to OpenAI's image generation API (gpt-image-2). Fetch Hive forces agent image size and quality to auto to control hosted LLM credit usage.

  • xAI agents — routes to Grok Imagine (grok-imagine-image-quality). OpenAI-only options (size, quality, background, etc.) are ignored.

  • Gemini agents — routes hosted requests to Gemini 2.5 Flash Image through Vertex AI. Personal/BYOK Gemini image generation is not supported yet. OpenAI-only options are ignored.

  • Other personal agents — route image generation through the workspace OpenAI provider key.

When enabled, the agent can generate one or more images at runtime and return them as permanent asset URLs.

Supports both hosted and personal billing models:

  • Hosted — images are billed against your workspace's hosted LLM credit balance (no API key required).

  • Personal — your workspace's own provider key is used and charged directly. OpenAI and xAI agents use their matching provider key; other personal agent providers use the workspace OpenAI key for images. Gemini personal image generation is not supported yet.

Adding the tool to an agent

  1. Open an agent in the editor.

  2. Click the button with the tooltip Add MCP Tool or Sub Agent.

  3. In MCP Tools, click Image Generation.

After you add the tool, select the Image Generation node to open its settings sheet.

Configuration

Option
Description

Billing

hosted uses Fetch Hive managed provider credentials and hosted LLM wallet checks; personal uses your workspace provider key and skips hosted-wallet precheck

Available options (exposed to the agent)

The agent controls these parameters when calling the tool:

Parameter
Description
Default

prompt

Text description of the desired image

Required

n

Number of images to generate (1–10)

1

size

1024x1024, 1536x1024, 1024x1536, or auto

auto

quality

high, medium, or low

medium

output_format

png, jpeg, or webp

png

background

transparent, opaque, or auto

auto

moderation

low or auto

auto

Output

Each generated image is uploaded to R2 storage and returned as an asset record with a permanent public URL. The agent receives the URL(s) and may include them in its response.

Before calling the image provider, Fetch Hive checks whether your account has reached its plan storage limit. If the limit is reached, the tool returns an error instead of generating new images.

Billing

  • OpenAI (gpt-image-2): token-based billing. Input image tokens, input text tokens, and output tokens are recorded in the completion and appear in your usage dashboard.

  • xAI (Grok Imagine): per-image billing at a fixed rate per image generated. Token fields are set to 0.

  • Gemini (gemini-2.5-flash-image): hosted token billing through Vertex AI. Personal/BYOK Gemini image generation is not supported yet. Input tokens and generated-image output tokens are recorded in the completion for hosted billing.

Use cases

  • Generate product mockups or illustration drafts from a prompt.

  • Create supporting visuals during a longer research or writing task.

  • Combine with Vector Search and SERP to produce richly illustrated reports.

Notes

  • Image Generation works with all supported LLM providers (OpenAI, Anthropic, xAI, Gemini). Context and credentials travel in a short-lived JWT from Fetch Hive to the image service.

  • For personal agents whose LLM provider is not OpenAI or xAI, configure an OpenAI provider key before enabling Image Generation. Gemini personal image generation is not supported yet.

  • Agent image generation is executed by Fetch Hive after the model emits create_image, so long-running generations are not limited by provider remote MCP timeouts.

  • For generating images from a workflow step (not an agent), see the Image Generation workflow step.

  • To add or remove tools from an agent, see Creating and Configuring.

Last updated