First:
you can not generate an image using OpenRouter credentials in the OpenAI node, you’ll need an OpenAI API key for this,
Second: DALL·E is not a valid model in OpenRouter,
Finally:
to generate an image with OpenRouter, you’ll need to use an HTTP node with the correct endpoint and model name, then parse the response to retrieve the image..
I try many times, but fail , when I want to defien the ratio 16:9 (e.g.), it seems fail and prompt “Invalid JSON in response body” , if i switch the model to gemini. very strange. I also refer to the image generation doc
This one is fail
{
“model”: “google/gemini-3-pro-image-preview”,
“messages”: [
{
“role”: “user”,
“content”: “Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme”
}
],
“modalities”: [“image”, “text”],
“image_config”: {
“aspect_ratio”: “16:9”,
“image_size”: “4K”
}
}
This one is OK
{
“model”: “google/gemini-3-pro-image-preview”,
“messages”: [
{
“role”: “user”,
“content”: “Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme”
}
}