---
title: generate_ai_gateway_image
description: Use generate_ai_gateway_image with Vercel MCP.
url: "https://vercel.com/docs/agent-resources/vercel-mcp/tools/ai-gateway/generate_ai_gateway_image"
last_updated: 2018-10-20
related:
  - /docs/ai-gateway
install_vercel_plugin: npx plugins add vercel/vercel-plugin
search_with_vercel_cli: npx vercel@latest docs search "<query>"
search_kb_with_vercel_cli: npx vercel@latest kb search "<query>"
---

# generate_ai_gateway_image

Creates new images from a text description, such as an illustration, icon, mockup, or photo, by running an image model on [AI Gateway](/docs/ai-gateway). The tool returns the generated images as MCP image content with a short JSON summary covering the team, model, image count, and usage.

This tool runs image-only models. Multimodal models that generate images through chat, such as `google/gemini-3-pro-image`, are not supported. It does not edit or describe existing images.

Each call runs a model on AI Gateway and is billed to the AI Gateway credits of the team in `teamId`, and every image is billed. The call authenticates with your Vercel MCP sign-in, so no AI Gateway API key is needed.

## Parameters

| Parameter      | Type   | Required | Description                                                                                                                                                                           |
| -------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `teamId`       | string | Yes      | The ID (`team_...`) or slug of the team whose AI Gateway credits pay for the call. Use `list_teams` to discover an unknown team. A connection bound to a team is billed to that team. |
| `prompt`       | string | Yes      | A description of the image to create, up to 4,000 characters.                                                                                                                         |
| `model`        | string | No       | The image model ID as `creator/model`. Defaults to `openai/gpt-image-2`. Use `list_ai_gateway_models` with type `image` to find other models and their prices.                        |
| `n`            | number | No       | Number of images to create, up to 4. Defaults to 1. Each image is billed.                                                                                                             |
| `size`         | string | No       | Image size as `WIDTHxHEIGHT`, such as `1024x1024` or `1536x1024`. Omit for the model default. Supported sizes vary by model.                                                          |
| `quality`      | string | No       | Rendering quality, for models that support it. One of `auto`, `high`, `medium`, or `low`.                                                                                             |
| `outputFormat` | string | No       | The image file format, one of `png`, `jpeg`, or `webp`. Defaults to `jpeg`, which keeps responses small. Use `png` for transparency or lossless output.                               |

## Limits

Results return in one response capped at 4.4 MB. The tool refuses up front any count, size, and format combination that could exceed this cap. If a request is refused, ask for fewer images, a smaller size, or `jpeg` or `webp` output.

Sample prompt: "Generate a 1024x1024 icon of a rocket in flat design."

## Search the docs from your terminal

Search the Vercel docs and read pages as Markdown with the Vercel CLI. No login required.

```bash
# Find docs pages by keyword
npx vercel@latest docs search "environment variables"
npx vercel@latest docs search "function timeout"

# Print a docs page as Markdown, by path or URL
npx vercel@latest docs inspect <page>
```

## Search guides from your terminal

Search the Knowledge Base and read guides as Markdown with the Vercel CLI. No login required.

```bash
# Find guides by keyword
npx vercel@latest kb search "rewrites and redirects"
npx vercel@latest kb search "AI SDK streaming"

# Show the latest guides
npx vercel@latest kb

# Print a guide as Markdown, by slug or URL
npx vercel@latest kb inspect <guide>
```

---

[View full sitemap](/docs/sitemap)


If you encounter incorrect information, can’t find what you need, need a capability Vercel doesn’t currently offer, or have any other feedback to report, please do it by following the instructions at https://vercel.com/feedback.md.
