{"slug": "unified-image-api", "title": "Unified Image API", "summary": "OpenRouter launched a Unified Image API providing standardized access to over 30 image generation models from providers including Google, OpenAI, and Black Forest Labs. The API includes a model discovery endpoint with typed capability descriptors, per-provider granularity for parameters and pricing, and support for streaming previews on GPT Image models. This simplifies model switching and reduces integration errors for developers and AI agents.", "body_md": "# Introducing the Unified Image API\n\nBrian Thomas ·\n\n## On this page\n\nImage generation on OpenRouter now has a dedicated API with unified access to 30+ models.\n\nLike all our media generation APIs, we’ve standardized the interface for easy model switching, allowed passthrough for unique model capabilities, and provided programmatic access to discover the details of each individual model. We support models from Google, OpenAI, Black Forest Labs, Recraft, ByteDance, Sourceful, Microsoft, and xAI, with more being added all the time.\n\n[Browse image models](https://openrouter.ai/models?output_modalities=image) | [API docs](https://openrouter.ai/docs/guides/overview/multimodal/image-generation) | [Try it in the playground](https://openrouter.ai/playground)\n\n## Know What Each Model Can Do\n\nImage models differ in ways that break requests. Seedream 4.5 supports 18 aspect ratios; Gemini 3.1 Flash Image supports 14 (overlapping, but not identical). Some models generate up to 10 images per call; others cap at 1. Some accept 16 input references; others accept 4.\n\nThe `/api/v1/images/models`\n\nendpoint returns typed capability descriptors for every model:\n\n```\n{\n  \"id\": \"bytedance-seed/seedream-4.5\",\n  \"supported_parameters\": {\n    \"resolution\": { \"type\": \"enum\", \"values\": [\"1K\", \"2K\", \"4K\"] },\n    \"aspect_ratio\": { \"type\": \"enum\", \"values\": [\"1:1\", \"16:9\", \"9:16\", \"...\"] },\n    \"n\": { \"type\": \"range\", \"min\": 1, \"max\": 10 },\n    \"input_references\": { \"type\": \"range\", \"min\": 0, \"max\": 14 },\n    \"seed\": { \"type\": \"boolean\" }\n  },\n  \"supports_streaming\": false\n}\n```\n\nYour code can adapt to any model without hardcoding provider differences or battling 400 errors over unacceptable parameters.\n\nThis is especially useful for agents. Give your coding agent the `/api/v1/images/models`\n\nresponse and it has everything it needs to pick a model, validate inputs, and generate images without trial-and-error.\n\n## Per-Provider Granularity\n\nEach model may be served by multiple providers. The per-endpoint records (`/api/v1/images/models/{id}/endpoints`\n\n) give you the definitive truth for each one: which parameters *this specific endpoint* accepts, what passthrough keys are allowed, streaming support, and granular pricing.\n\n```\ncurl \"https://openrouter.ai/api/v1/images/models/google/gemini-3.1-flash-image/endpoints\"\n```\n\nEach endpoint also returns a `pricing`\n\narray with the exact billing structure. Different providers charge in different units:\n\n```\n\"pricing\": [\n  { \"billable\": \"output_image\", \"unit\": \"image\", \"cost_usd\": 0.04 }\n]\n```\n\nSeedream 4.5 charges a flat $0.04 per image. FLUX.2 Pro bills at $0.03 per megapixel (so resolution affects cost). GPT-5.4 Image 2 and Gemini 3.1 Flash Image bill per token. No more guessing why a generation cost what it did; the `usage`\n\nobject in every response includes the exact cost in USD.\n\n## One Request Shape, Any Model\n\nThe API normalizes the fragmented world of image generation into one schema:\n\n```\ncurl -X POST \"https://openrouter.ai/api/v1/images\" \\\n  -H \"Authorization: Bearer $OPENROUTER_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"bytedance-seed/seedream-4.5\",\n    \"prompt\": \"a red panda astronaut floating in space, studio lighting\",\n    \"resolution\": \"2K\",\n    \"aspect_ratio\": \"16:9\"\n  }'\n```\n\nResolution, aspect ratio, quality, output format, background transparency, input references, streaming: all normalized across every provider. When you need provider-specific features (like Black Forest Labs’ `steps`\n\nor `guidance`\n\n), pass them through `provider.options`\n\nkeyed by the provider slug from the endpoints API.\n\n## Streaming Previews for GPT Image Models\n\nOpenAI’s GPT Image models (GPT-5 Image, GPT-5 Image Mini, GPT-5.4 Image 2) support native SSE streaming through the Image API. Set `\"stream\": true`\n\nand you’ll receive partial image previews as they’re rendered, so users see progress instead of waiting for the full generation. Check the `supports_streaming`\n\nfield on any endpoint to see if it’s available.\n\n## FAQ\n\n### What happens to image generation through chat completions?\n\nUntil now, we supported image generation via completions and responses. All existing image models continue to be supported here, however new image models will be added exclusively to the dedicated Image API.\n\nIf you’re using `openai/gpt-5-image`\n\n, `openai/gpt-5-image-mini`\n\n, or `openai/gpt-5.4-image-2`\n\n, we recommend switching to one of the dedicated image models. The GPT 5 and 5.4 versions generate images through an LLM, so they don’t provide access to the full set of supported parameters and may incur extra inference cost.\n\n### Can I use provider-specific features?\n\nYes. Each endpoint exposes an `allowed_passthrough_parameters`\n\nlist. Pass provider-specific keys under `provider.options`\n\nkeyed by the provider slug. The endpoints API tells you exactly which keys are accepted.\n\n### How does pricing work?\n\nEach endpoint returns granular pricing lines with a billable unit, cost in USD, and optional variant tiers (e.g., resolution-based pricing). The `usage`\n\nobject in every response includes the exact cost.\n\nTell us what you think and which models you want next in [#feedback](https://discord.gg/fVyRaUDgxW) on Discord.", "url": "https://wpnews.pro/news/unified-image-api", "canonical_source": "https://openrouter.ai/blog/announcements/image-api/", "published_at": "2026-06-24 09:04:02+00:00", "updated_at": "2026-06-24 09:14:11.967970+00:00", "lang": "en", "topics": ["ai-tools", "ai-products", "developer-tools", "generative-ai", "ai-infrastructure"], "entities": ["OpenRouter", "Google", "OpenAI", "Black Forest Labs", "ByteDance", "Microsoft", "xAI", "Seedream"], "alternates": {"html": "https://wpnews.pro/news/unified-image-api", "markdown": "https://wpnews.pro/news/unified-image-api.md", "text": "https://wpnews.pro/news/unified-image-api.txt", "jsonld": "https://wpnews.pro/news/unified-image-api.jsonld"}}