Server tools are currently in beta. The API and behavior may change.
The openrouter:image_generation server tool enables any model to generate images from text prompts. When the model determines it needs to create an image, it calls the tool with a description. OpenRouter executes the image generation and returns the result to the model.
{ "type": "openrouter:image_generation" } in your tools array.openai/gpt-5-image).The image generation tool accepts optional parameters to customize the output:
All parameters except model are passed directly to the underlying image generation API. Available options depend on the specific model being used.
When the model calls the image generation tool, it receives a response like:
If generation fails, the response includes an error:
The image generation server tool also works with the Responses API:
Image generation pricing depends on the underlying model used:
The cost is in addition to standard LLM token costs for processing the request and response.