Generate image (OpenAI)
generate_imageCreates images from text prompts using the OpenAI Images API, with per-call model, size, and quality selection. Saves results to disk and returns file paths for use.
Instructions
Generate images from a text prompt with the OpenAI Images API. Choose the model per call. Images are saved to disk and their paths returned.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Number of images (1–10). Default 1. | |
| size | No | "auto", "1024x1024", "1536x1024" (landscape), "1024x1536" (portrait). gpt-image-2 and 2.5 models also accept any WIDTHxHEIGHT: multiples of 16, aspect 1:3–3:1, max 3840x2160 (e.g. "1920x1088", "3840x2160"). | |
| model | No | OpenAI image model. Known: gpt-image-2.5-flare, gpt-image-2.5-sunburst, gpt-image-2, gpt-image-1.5, chatgpt-image-latest, gpt-image-1-mini. Dated snapshots (e.g. gpt-image-2-2026-04-21) also work. Default: gpt-image-2.5-flare. Call list_models for capabilities. | gpt-image-2.5-flare |
| prompt | Yes | What to generate. Describe style in the prompt. | |
| quality | No | Default "auto". xhigh and max are only on gpt-image-2.5-flare / -sunburst. | |
| background | No | "transparent" needs output_format png or webp. | |
| moderation | No | "low" = less restrictive filtering. | |
| output_dir | No | Where to save files. Default /root/Pictures/openai-image-mcp. | |
| output_format | No | Default png. | |
| include_images | No | Also return the images inline so the client can display them. Large; off by default. | |
| filename_prefix | No | File name prefix. Defaults to a slug of the prompt. | |
| output_compression | No | 0–100, jpeg/webp only. |