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

Google: Gemini 3.1 Flash Lite Image (Nano Banana 2 Lite)

google-ai.image-gen.gemini-3-1-flash-lite-image

Generate or edit one 1K image with Gemini 3.1 Flash Lite Image on Google's own API, the cheapest Gemini image model; the image returns inline as base64.

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

参数

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

    gemini-3.1-flash-lite-image is the stable model; the -preview alias is the same model at the same price.

    示例:gemini-3.1-flash-lite-image

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

    Google's partial-response mask; the example drops the multi-megabyte thoughtSignature. Keep usageMetadata in any mask you send.

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

代码示例

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

Beta
curl -X POST 'https://toolswitch.dev/v1/tools/google-ai.image-gen.gemini-3-1-flash-lite-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"]}}'

网关接口为 Beta,地址与鉴权方式可能变更。 示例参数仅为样例数据。 调用按 $0.04/success 计费,已含服务费。