跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.crazyrouter.com/llms.txt

Use this file to discover all available pages before exploring further.

Gemini 图片编辑

POST /v1/images/generations
Gemini / Nano Banana 图片编辑在 Crazyrouter 上统一走 OpenAI Images 兼容入口。用户只需要传 image_input URL 和统一参数,服务端会处理 Gemini / Vertex 原生格式转换。
图片编辑、多参考图这类请求通常耗时较长。生产接入请优先使用主承接线路 https://cn.crazyrouter.com/v1,完整端点为 https://cn.crazyrouter.com/v1/images/generations

当前建议

  1. 新接入优先使用 nano-banana-2nano-banana-pro
  2. 图片输入使用 image_input,传 URL 或 URL 数组
  3. 不要传 Gemini 原生字段,例如 generationConfigimageConfigimageOutputOptions
  4. 客户端超时建议设置为 180 秒以上

请求模板

下面是通过统一 Images API 做参考图编辑的最小请求:
curl -X POST https://cn.crazyrouter.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "nano-banana-2",
    "prompt": "把参考图背景改成蓝色,保留主体结构和边缘细节",
    "image_input": [
      "https://example.com/reference.png"
    ],
    "resolution": "1K",
    "aspect_ratio": "1:1",
    "output_format": "png"
  }'