#How to list image model in API
7 messages · Page 1 of 1 (latest)
I'm an AI assistant - my answers may be incorrect and I cannot see screenshots. Please verify information with the OpenRouter docs.
To programmatically list models that support image generation, use the /models API endpoint and filter for models where "image" is present in their output_modalities. According to the documentation:
"OpenRouter supports image generation through models that have "image" in their output_modalities... You can find image generation models in several ways... use the Models page and filter by output modalities to find models capable of image generation."
Image Gen Guide
The API endpoint you should query is:
GET <https://openrouter.ai/api/v1/models>
Then, filter results client-side for models where:
"output_modalities": ["image", ...]
If models like black-forest-labs/flux.2-max are not returned, it's possible they are not currently listed via the public API. You can verify available image models on the OpenRouter Models page, filtering by output modalities ["image"] for the most up-to-date list.
"Not all models support image generation... Use the Models page to find available image generation models—filter by output modalities to see compatible models."
Image Models Docs
If you don't find the model via API, it might not be available for public programmatic query. In this case, check the models page or contact support for clarification.
-# This is an automated response powered by Answer HQ. Use !mute to stop the bot from responding, or !close when your question is resolved.
Do you mean https://openrouter.ai/api/v1/models, I don't find black-forest-labs/flux.2-max there.
It's correct that the /api/v1/models endpoint does not currently return a listing for black-forest-labs/flux.2-max. Only two Black Forest Labs models are officially offered through OpenRouter at this time:
Both are listed on the Black Forest Labs models page, and those are the only available options for programmatic use through the OpenRouter API at this time. If flux.2-max is not appearing in the API list, it is not currently available for use via OpenRouter Black Forest Labs Models.
"Browse models from black-forest-labs... Black Forest Labs: FLUX.2 Flex ... Black Forest Labs: FLUX.2 Pro"
Black Forest Labs Models
If you need to monitor new model availability, check the OpenRouter Models catalog regularly.
-# This is an automated response powered by Answer HQ. Use !mute to stop the bot from responding, or !close when your question is resolved.
So in the future, will that(programmatic way to list image-gen-only model) be available?
I don't have specific documentation for future additions to the OpenRouter API, and there's no statement confirming that a programmatic way to list image-generation-only models will be available soon. For now, the best way to find current image-gen models is to use the OpenRouter Models page and filter by output modalities ["image"].
For updates on new API features, you should periodically check the OpenRouter docs or the #announcements channel in Discord. If you have a feature request, you can also contact mods in the Discord server.
-# This is an automated response powered by Answer HQ. Use !mute to stop the bot from responding, or !close when your question is resolved.
!close