Google AI (Gemini API)图像生成AI generation

Google: Gemini 3 Pro Image (Nano Banana Pro)

google-ai.image-gen.gemini-3-pro-image

Generate or edit one image with Gemini 3 Pro Image at 1K, 2K or 4K on Google's own API, from a prompt and optional reference image URLs; the image returns inline as base64.

价格
$0.26/success按供应商原价
成功率
98.4%近 30 天 · 3,179 次
延迟 p50
22 秒p95 34 秒
最后验证
2026年9月29日实测可用
POSThttps://toolswitch.dev/v1/tools/google-ai.image-gen.gemini-3-pro-image?fields=candidates%28content%28parts%28text%2CinlineData%29%29%2CfinishReason%29%2CusageMetadata%2CmodelVersion%2CresponseId%2CpromptFeedback预览
  • 可用平台额度调用
  • 同步返回
  • 读取公开数据

参数

参数类型必填说明示例
路径参数
model字符串必填gemini-3-pro-image is the stable model; the -preview alias is the same model at the same price.gemini-3-pro-image
查询参数
fields字符串可选Google's partial-response mask. The example drops the multi-megabyte thoughtSignature and roughly halves the answer; keep usageMetadata in any mask you send.candidates(content(parts(text,inlineData)),finishReason),usageMetadata,modelVersion,responseId,promptFeedback
  • 路径参数
  • model字符串必填

    gemini-3-pro-image is the stable model; the -preview alias is the same model at the same price.

    示例:gemini-3-pro-image

  • 查询参数
  • fields字符串可选

    Google's partial-response mask. The example drops the multi-megabyte thoughtSignature and roughly halves the answer; keep usageMetadata in any mask you send.

    示例:candidates(content(parts(text,inlineData)),finishReason),usageMetadata,modelVersion,responseId,promptFeedback

代码示例

将 $TOOLSWITCH_KEY 替换为你在控制台创建的密钥。

预览
curl -X POST 'https://toolswitch.dev/v1/tools/google-ai.image-gen.gemini-3-pro-image?fields=candidates%28content%28parts%28text%2CinlineData%29%29%2CfinishReason%29%2CusageMetadata%2CmodelVersion%2CresponseId%2CpromptFeedback' \
  -H "X-Toolswitch-Key: $TOOLSWITCH_KEY" \
  -H "Content-Type: application/json" \
  --data-raw '{"contents":[{"parts":[{"text":"A clean editorial illustration of a paper airplane."}]}],"generationConfig":{"imageConfig":{"imageSize":"1K","aspectRatio":"1:1"},"responseModalities":["IMAGE"]}}'

网关接口为预览版,地址与鉴权方式可能调整。 示例参数仅为样例数据。 调用按 $0.26/success 计费,已含服务费。