generate_image
Generate images by providing a text description, with optional control over aspect ratio, size, quality, and output format.
Instructions
Generate an image using an OpenRouter image generation model.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Image size - 1K, 2K, or 4K | 1K |
| model | No | Image model (e.g., "google/gemini-3-pro-image-preview"). If not specified, uses DEFAULT_IMAGE_MODEL environment variable. | |
| prompt | Yes | Image description - be specific about style, colors, composition | |
| quality | No | Quality setting (e.g., "high", "medium", "low") | |
| background | No | Background setting (e.g., "transparent" for PNG/WebP) | |
| output_path | No | Optional absolute file path to save the image. Must be an absolute path if provided (e.g., "/Users/name/output.png"). | |
| aspect_ratio | No | Aspect ratio - 1:1, 16:9, 9:16, 4:3, 3:4, or 21:9 | 1:1 |
| output_format | No | Output format (e.g., "png", "webp", "jpeg") |