> ## Documentation Index
> Fetch the complete documentation index at: https://doc.geekapis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini 3 Pro 图像生成 API | 多分辨率图像接口

> 使用 Google Gemini 3 Pro 图像模型生成高质量图片，支持 1K/2K/4K 分辨率、多宽高比及图生图，同步任务接口。

## 请求参数

<ParamField body="model" default="gemini-3-pro-image-preview" type="string" required>
  图像生成模型名称。

  示例：`"gemini-3-pro-image"`
</ParamField>

<ParamField body="prompt" type="string" required>
  图像生成的文本描述。上游模型输入上限为 65,536 tokens，即刻API 不额外设置 1000 字符限制。

  示例：`"未来城市的天际线，霓虹灯光"`
</ParamField>

<ParamField body="size" type="string">
  图像生成的尺寸比例。输出图像的宽高比必须为具体清晰度，支持的格式：

  `1K: 1:1=1024x1024, 16:9=1360x768, 9:16=768x1360, 4:3=1152x864, 3:4=864x1152`

  `2K: 1:1=2048x2048, 16:9=2752x1536, 9:16=1536x2752, 4:3=2048x1536, 3:4=1536x2048`

  `4K: 1:1=4096x4096, 16:9=5504x3072, 9:16=3072x5504, 4:3=4096x3072, 3:4=3072x4096`

  <ParamField body="image_urls" type="object[]">
    参考图像 URL 列表，用于图生图或图像编辑。
  </ParamField>
</ParamField>

## 请求示例

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://geekapis.com/v1/images/generations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "gemini-3-pro-image",
      "prompt": "未来城市的天际线，霓虹灯光",
      "size": "1360x768",
      "n": 1
    }'
  ```

  ```bash cURL (图生图) theme={null}
  curl --request POST \
    --url https://geekapis.com/v1/images/generations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "gemini-3-pro-image",
      "prompt": "保持人物风格，将背景替换为樱花公园",
      "n": 1,
      "image_urls": [
        {
          "url": "https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg"
        }
      ]
    }'
  ```
</CodeGroup>

## 响应示例

```json theme={null}
{
  "created": 1750838400,
  "model": "firefly-nano-banana-pro-1k-16x9",
  "data": [
    {
      "b64_json": "iVBORw0KGgoAAAANSUhEUgAA...",
      "revised_prompt": "未来城市的天际线，霓虹灯光"
    }
  ]
}
```
