图片 & 视频 API
通过统一接口,使用 OpenAI 兼容的图片格式生成图片和视频。
接口地址
图片和视频生成共用同一个接口。发送 POST 请求带上提示词,网关会自动路由到最优的上游账户。
Endpoint
POST https://console.bnrouter.com/v1/images/generations图片生成
根据文字描述生成图片。请求遵循 OpenAI images/generations 格式。Flux Pro、DALL·E 3、Stable Diffusion 3 等模型均可通过同一接口使用。
将 model 设为模型广场中的任意图片模型 ID。响应中会包含一个或多个生成的图片 URL。
curl
curl https://console.bnrouter.com/v1/images/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-pro",
"prompt": "A serene mountain lake at sunrise, photorealistic",
"n": 1,
"size": "1024x1024"
}'图片编辑
通过提供蒙版和新的提示词来编辑已有图片。发送 multipart/form-data 请求,包含图片、蒙版和提示词字段。
只有支持修补(inpainting)的模型才接受编辑操作。请查看模型广场了解哪些模型支持编辑。
curl
curl https://console.bnrouter.com/v1/images/edits \
-H "Authorization: Bearer sk-your-api-key" \
-F "image=@./input.png" \
-F "mask=@./mask.png" \
-F "prompt=Replace the background with a futuristic cityscape" \
-F "n=1" \
-F "size=1024x1024"视频生成
根据文字或图片提示词生成短视频。同一接口和认证方式也适用于视频模型。由于视频生成的计算成本,响应时间会更长。
视频能力正在快速扩展中。请在模型广场查看最新可用的视频模型。
curl
curl https://console.bnrouter.com/v1/images/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "A cinematic aerial view of a futuristic city at night",
"n": 1,
"size": "1920x1080"
}'用量与计费
图片和视频请求按模型广场展示的价格按次计费。图片尺寸、质量(hd/standard)和请求数量会影响 Token 消耗。
用量与对话补全一同在看板中追踪,方便你统一查看网关的所有活动。
模型百科页面
- GoogleGemini 4 Argon API
- MetaMuse Wonder API
- OpenMOSSMOSS Image API
- BriaFibo 2.0 API
- Black Forest LabsFLUX 3 Video API
- Black Forest LabsFLUX 3 Image Klein API
- GoogleNano Banana 2.1 API
- AnthropicClaude Haiku 5.5 API
- xAIGrok Imagine Video 1.5 Lite API
- ViduVidu Q4 API
- Alibaba QwenQwen-Image-2.1-Turbo API
- AlibabaWan 3.0 API
- OpenAIGPT Image 2.5 API
- KreaKrea 3 API
- ByteDance SeedSeedance 2.5 API
- Kling AIKling 4.0 API
- IdeogramIdeogram Vector API
- Moonshot / KimiKimi K3.1 Pro API
- DeepSeekDeepSeek V4.1 Flash API
- Zhipu / Z.aiGLM 5.3 Flash API
- InceptionMercury 3 API
- MiniMaxMiniMax M3.1 Flash API
- AnthropicClaude Opus 5.5 API
- AnthropicClaude Sonnet 5.5 API
- Mistral AIMistral Large 4 API
- ByteDance SeedSeedream 5.0 API
- Lightricks / LTXLTX-2.5 API
- MiniMaxMiniMax H3 Max API
- OpenAIGPT-6.1 Terra API
- RecursiveFlint API(Recursive)