使用 Google Gemini 模型生成图像,支持多种宽高比和高达 4K 分辨率
https://api.wisgate.ai(替换 generativelanguage.googleapis.com)$GEMINI_API_KEY 替换为您的 $WISDOM_GATE_KEYopenapi.json 提取。向下滚动查看交互式 API 参考。| 模型 | 说明 | 分辨率 | 宽高比 |
|---|---|---|---|
gemini-3.1-flash-image-preview(Nano Banana 2) | Gemini 3 Pro Image 的高效版本,针对速度优化 | 0.5K, 1K, 2K, 4K | 1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9 |
gemini-3-pro-image-preview | 全功能图像生成模型 | 1K, 2K, 4K | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 |
gemini-2.5-flash-image | 快速经济的图像生成 | 1K, 2K | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 |
imageConfig 字段中设置 aspectRatio 和 imageSize:
gemini-3-pro-image-preview 模型。在 imageConfig 中设置 "imageSize": "1K":
"responseModalities": ["IMAGE"](不含 TEXT):
inlineData 字段中返回:
gemini-3.1-flash-image-preview(Nano Banana 2)和 gemini-2.5-flash-image 比 gemini-3-pro-image-preview 更经济usageMetadata 字段Bearer token authentication. Include your API key in the Authorization header as 'Bearer YOUR_API_KEY'
The model identifier (e.g., 'gemini-pro', 'gemini-pro-vision')
The operation to perform. Use 'generateContent' for standard requests, or 'streamGenerateContent?alt=sse' for streaming responses with Server-Sent Events format.