OpenRouter supports image generation via the Chat Completions and Responses endpoints. You can find the supported models, their capabilities, and pricing by filtering our model list by image output.
You can find image generation models in several ways:
Use the output_modalities query parameter on the Models API to programmatically discover image generation models:
See Models - Query Parameters for the full list of supported modality values.
Visit the Models page and filter by output modalities to find models capable of image generation. Look for models that list "image" in their output modalities.
When using the Chatroom, click the Image button to automatically filter and select models with image generation capabilities. If no image-capable model is active, you’ll be prompted to add one.
To generate images, send a request to the /api/v1/chat/completions endpoint with the modalities parameter. The value depends on the model’s capabilities:
modalities: ["image", "text"]modalities: ["image"]Some image generation models support additional configuration through the image_config parameter.
Set image_config.aspect_ratio to request specific aspect ratios for generated images.
Supported aspect ratios:
1:1 → 1024×1024 (default)2:3 → 832×12483:2 → 1248×8323:4 → 864×11844:3 → 1184×8644:5 → 896×11525:4 → 1152×8969:16 → 768×134416:9 → 1344×76821:9 → 1536×672Extended aspect ratios (supported by google/gemini-3.1-flash-image-preview only):
1:4 → Tall, narrow format ideal for scrolling carousels and vertical UI elements4:1 → Wide, short format for hero banners and horizontal layouts1:8 → Extra-tall format for notification headers and narrow vertical spaces8:1 → Extra-wide format for wide-format banners and panoramic layoutsSet image_config.image_size to control the resolution of generated images.
Supported sizes:
1K → Standard resolution (default)2K → Higher resolution4K → Highest resolution0.5K → Lower resolution, optimized for efficiency (supported by google/gemini-3.1-flash-image-preview only)You can combine both aspect_ratio and image_size in the same request:
Set image_config.strength to control how much the output image differs from the input image during image-to-image generation. This parameter only applies when input images are provided in messages. It is only supported by Recraft models.
0.0 to 1.00.2Example:
Use image_config.text_layout to place text at specific positions on the generated image. Each entry specifies the text to render and a bounding box defined by four corner points in normalized coordinates (0 to 1). This parameter is only supported by Recraft V3 (recraft/recraft-v3) for both text-to-image and image-to-image requests. Recraft V4 and V4 Pro do not support text_layout.
Each text layout entry is an object with:
text (required): The text string to renderbbox (required): Array of 4 [x, y] coordinate pairs defining the bounding box corners (top-left, top-right, bottom-right, bottom-left), with values from 0 to 1Example:
Use image_config.style to apply a specific artistic style to the generated image. This parameter is only supported by Recraft V3 (recraft/recraft-v3). Recraft V4 and V4 Pro do not support styles.
See the full list of available styles in Recraft’s documentation. Note that vector styles are not supported.
Example:
Use image_config.rgb_colors to specify a color palette that influences the generated image. Each color is a [r, g, b] array of three integers (0 to 255). This parameter is supported by Recraft models for both text-to-image and image-to-image requests.
Example:
Use image_config.background_rgb_color to set a specific background color for the generated image. The value is a [r, g, b] array of three integers (0 to 255). This parameter is supported by Recraft models for both text-to-image and image-to-image requests.
Example:
You can combine rgb_colors and background_rgb_color in the same request:
Use image_config.font_inputs to render custom text with specific fonts in generated images. The text you want to render must also be included in your prompt for best results. This parameter is only supported by Sourceful models (sourceful/riverflow-v2-fast and sourceful/riverflow-v2-pro).
Each font input is an object with:
font_url (required): URL to the font filetext (required): Text to render with the fontLimits:
Example:
Tips for best results:
text parameter should match exactly what’s in your prompt - avoid extra wording or quotation marksUse image_config.super_resolution_references to enhance low-quality elements in your input image using high-quality reference images. The output image will match the size of your input image, so use larger input images for better results. This parameter is only supported by Sourceful models (sourceful/riverflow-v2-fast and sourceful/riverflow-v2-pro) when using image-to-image generation (i.e., when input images are provided in messages).
Limits:
messages)Example:
Tips for best results:
Image generation also works with streaming responses:
When generating images, the assistant message includes an images field containing the generated images:
data:image/png;base64,)Not all models support image generation. To use this feature:
"image" in its output_modalities["image", "text"] for models that output both, or ["image"] for image-only modelsgoogle/gemini-3.1-flash-image-preview (supports extended aspect ratios and 0.5K resolution)google/gemini-2.5-flash-imageblack-forest-labs/flux.2-problack-forest-labs/flux.2-flexsourceful/riverflow-v2-standard-previewimages field in responses before processingNo images in response?
output_modalities includes "image")modalities parameter correctly: ["image", "text"] for models that output both, or ["image"] for image-only modelsModel not found?