惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
MongoDB | Blog
MongoDB | Blog
Blog — PlanetScale
Blog — PlanetScale
腾讯CDC
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Apple Machine Learning Research
Apple Machine Learning Research
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
MyScale Blog
MyScale Blog
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
N
Netflix TechBlog - Medium
阮一峰的网络日志
阮一峰的网络日志
博客园 - Franky
Recent Announcements
Recent Announcements
A
About on SuperTechFans
Stack Overflow Blog
Stack Overflow Blog
The GitHub Blog
The GitHub Blog
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More

OpenRouter Blog

Using OpenRouter With LangChain (ChatOpenRouter) — OpenRouter Blog How to Evaluate LLM Provider Performance — OpenRouter Blog Image Generation API on OpenRouter: Generate + Read Images — OpenRouter Blog Classifiers: Track What Your Agents Do and What It Costs — OpenRouter Blog Transcription on OpenRouter: Whisper & More STT Models — OpenRouter Blog OpenRouter Prompt Caching: What Cached Tokens Cost — OpenRouter Blog One API for Image, Video, Audio, Embeddings & Transcription — OpenRouter Blog A New Look for OpenRouter — OpenRouter Blog Why Use OpenRouter for DeepSeek — OpenRouter Blog Choosing the Optimal Image Input Detail Level in LLMs — OpenRouter Blog DeepSeek V4 Is Earning Agentic Token Share — OpenRouter Blog The Open Weight Models that Matter: June 2026 — OpenRouter Blog The OpenRouter MCP Server — OpenRouter Blog The AI Governance Checklist That Maps to Your Stack — OpenRouter Blog Enforce AI Data Residency at the Routing Layer — OpenRouter Blog OpenRouter vs Portkey: Routing Network vs Control Plane — OpenRouter Blog OpenRouter vs LiteLLM: Managed vs Self-Hosted Gateway — OpenRouter Blog Connect OpenClaw to OpenRouter: One Key, Failover, Free Models — OpenRouter Blog Connect SillyTavern to OpenRouter: Setup, Models, Fixes — OpenRouter Blog A Robot is Sprinting Towards You: Do You Want it Running on Claude or Grok? Kilo Code + OpenRouter: Setup, Routing, and Free Models — OpenRouter Blog Codex CLI with OpenRouter: config.toml Setup and Models — OpenRouter Blog Claude Code with OpenRouter: Setup, Models, and Costs — OpenRouter Blog How to Use OpenRouter With Any Coding Agent or AI Tool — OpenRouter Blog Subagent: Let Your Model Delegate the Busywork — OpenRouter Blog Free LLM API in 2026: 13 Options Ranked and Compared — OpenRouter Blog How to Enforce Agentic AI Governance at the API Layer — OpenRouter Blog Keep Your Agent Running When Models Disappear — OpenRouter Blog Hermes Agent + OpenRouter: Setup, Model Choice & Routing Config — OpenRouter Blog Lowest-Cost LLM Inference: The Complete OpenRouter Guide — OpenRouter Blog
Introducing the Unified Image API — OpenRouter Blog
Brian Thomas · 2026-06-23 · via OpenRouter Blog

Image generation on OpenRouter now has a dedicated API with unified access to 30+ models.

Like 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.

Browse image models | API docs | Try it in the playground

Know What Each Model Can Do

Image 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.

The /api/v1/images/models endpoint returns typed capability descriptors for every model:

{
  "id": "bytedance-seed/seedream-4.5",
  "supported_parameters": {
    "resolution": { "type": "enum", "values": ["1K", "2K", "4K"] },
    "aspect_ratio": { "type": "enum", "values": ["1:1", "16:9", "9:16", "..."] },
    "n": { "type": "range", "min": 1, "max": 10 },
    "input_references": { "type": "range", "min": 0, "max": 14 },
    "seed": { "type": "boolean" }
  },
  "supports_streaming": false
}

Your code can adapt to any model without hardcoding provider differences or battling 400 errors over unacceptable parameters.

This is especially useful for agents. Give your coding agent the /api/v1/images/models response and it has everything it needs to pick a model, validate inputs, and generate images without trial-and-error.

Per-Provider Granularity

Each model may be served by multiple providers. The per-endpoint records (/api/v1/images/models/{id}/endpoints) give you the definitive truth for each one: which parameters this specific endpoint accepts, what passthrough keys are allowed, streaming support, and granular pricing.

curl "https://openrouter.ai/api/v1/images/models/google/gemini-3.1-flash-image/endpoints"

Each endpoint also returns a pricing array with the exact billing structure. Different providers charge in different units:

"pricing": [
  { "billable": "output_image", "unit": "image", "cost_usd": 0.04 }
]

Seedream 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 object in every response includes the exact cost in USD.

One Request Shape, Any Model

The API normalizes the fragmented world of image generation into one schema:

curl -X POST "https://openrouter.ai/api/v1/images" \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bytedance-seed/seedream-4.5",
    "prompt": "a red panda astronaut floating in space, studio lighting",
    "resolution": "2K",
    "aspect_ratio": "16:9"
  }'

Resolution, 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 or guidance), pass them through provider.options keyed by the provider slug from the endpoints API.

Streaming Previews for GPT Image Models

OpenAI’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 and 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 field on any endpoint to see if it’s available.

FAQ

What happens to image generation through chat completions?

Until 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.

If you’re using openai/gpt-5-image, openai/gpt-5-image-mini, or openai/gpt-5.4-image-2, 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.

Can I use provider-specific features?

Yes. Each endpoint exposes an allowed_passthrough_parameters list. Pass provider-specific keys under provider.options keyed by the provider slug. The endpoints API tells you exactly which keys are accepted.

How does pricing work?

Each endpoint returns granular pricing lines with a billable unit, cost in USD, and optional variant tiers (e.g., resolution-based pricing). The usage object in every response includes the exact cost.


Tell us what you think and which models you want next in #feedback on Discord.