Summary
generate_image_openrouter in sdk/python/agentfield/vision.py 404s for every request when called with image_config={"aspect_ratio": "9:16"} against google/gemini-2.5-flash-image. Without image_config, the same call succeeds.
OpenRouter's current provider matrix for google/gemini-2.5-flash-image apparently has no upstream replica that exposes the image_config.aspect_ratio parameter, so routing returns empty.
Repro
from agentfield.vision import generate_image_openrouter
await generate_image_openrouter(
prompt="A vertical portrait",
model="openrouter/google/gemini-2.5-flash-image",
size="1024x1024",
quality="standard",
style=None,
response_format="url",
image_config={"aspect_ratio": "9:16"},
)
Error
litellm.NotFoundError: NotFoundError: OpenrouterException -
{"error":{"message":"No endpoints found that support the requested
output modalities: image, text","code":404}}
(Note: on origin/main the SDK now sends modalities=["image"] only, but the underlying provider-matrix limitation around image_config.aspect_ratio may still cause a 404 for this specific combination.)
Suggested fix
When image_config is non-empty and OpenRouter returns this specific 404 ("No endpoints found that support the requested output modalities..."), either:
- transparently retry without
image_config and surface a warning, or
- raise a clearer error: "no upstream provider for model X accepts image_config; drop the parameter or pick a different model"
Consumer workaround
reel-af drops image_config entirely, asks for vertical composition in the prompt, and center-crops the square output to 9:16 itself.
Found by the Python SDK consumer reel-af (an AgentField example pipeline).
Summary
generate_image_openrouterinsdk/python/agentfield/vision.py404s for every request when called withimage_config={"aspect_ratio": "9:16"}againstgoogle/gemini-2.5-flash-image. Withoutimage_config, the same call succeeds.OpenRouter's current provider matrix for
google/gemini-2.5-flash-imageapparently has no upstream replica that exposes theimage_config.aspect_ratioparameter, so routing returns empty.Repro
Error
(Note: on
origin/mainthe SDK now sendsmodalities=["image"]only, but the underlying provider-matrix limitation aroundimage_config.aspect_ratiomay still cause a 404 for this specific combination.)Suggested fix
When
image_configis non-empty and OpenRouter returns this specific 404 ("No endpoints found that support the requested output modalities..."), either:image_configand surface a warning, orConsumer workaround
reel-af drops
image_configentirely, asks for vertical composition in the prompt, and center-crops the square output to 9:16 itself.Found by the Python SDK consumer
reel-af(an AgentField example pipeline).