API 参考Gemini 图像原生接口
Gemini 图片(Nano Banana)
Gemini 图片生成
授权
BearerAuth 授权Bearer <token>
使用 Bearer Token 认证。
格式: Authorization: Bearer sk-xxxxxx
位置: header
路径参数
model*string
模型名称
请求主体
application/json
TypeScript 定义
在 TypeScript 中使用 request body 类型。
响应主体
application/json
curl -X POST "https://example.com/v1beta/models/gemini-3-pro-image:generateContent" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "role": "user", "parts": [ { "text": "draw a red apple on a white table, product photo" } ] } ], "generationConfig": { "responseModalities": [ "IMAGE", "TEXT" ], "responseFormat": { "image": { "aspectRatio": "1:1", "imageSize": "1K" } } } }'{ "candidates": [ { "content": { "role": "string", "parts": [ {} ] }, "finishReason": "string", "safetyRatings": [ {} ] } ], "usageMetadata": { "promptTokenCount": 0, "candidatesTokenCount": 0, "totalTokenCount": 0 }}