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

# Gemini 3 Pro Image 图像生成

> gemini-3-pro-image 的生成请求与响应。

## 模型选择

| 模型 ID | 请求地址 |
| - | - |
| `gemini-3-pro-image` | `POST /v1/images/generations` |

渠道会将对外模型 `gemini-3-pro-image` 映射为 `gemini-3-pro-image-preview` 后发送至 APIMart。

## 主要参数

下表列出常用参数；媒体引用的组合限制以接口校验结果为准。

| 字段 | 取值或限制 | 说明 |
| - | - | - |
| `model` | `gemini-3-pro-image` | 对外请求的模型 ID |
| `prompt` | string | 图片生成或编辑的文字描述；必填 |
| `size` | `auto`、`1:1`、`2:3`、`3:2`、`3:4`、`4:3`、`4:5`、`5:4`、`9:16`、`16:9`、`21:9`；默认 `auto` | 输出宽高比；图生图建议指定比例 |
| `resolution` | `1K`、`2K`、`4K`；默认 `1K` | 输出分辨率（当前网关不接受 0.5K） |
| `n` | `1`；默认 `1` | 每次生成 1 张 |
| `image_urls` | 最多 14 项 | 图像编辑参考图，最多 14 张；每张不超过 30MB；支持公开 URL 或图片 Data URI |
| `nsfw_check` | `true` / `false`；默认 `false` | 提交前进行内容审核；默认为 false |
| `official_fallback` | `true` / `false`；默认 `false` | 可选的官方线路回退；可能使用不同计费档位 |
| `response_format` | `url` | 本网关仅支持 url 响应格式 |

## 返回说明

成功时返回 `data[].url`。如返回 504 与 `task_id`，请先查询原任务，不要直接重复提交。


## OpenAPI

````yaml generated/gemini-3-pro-image-preview.json POST /v1/images/generations
openapi: 3.0.3
info:
  title: new-api Gemini 3 Pro Image API
  version: 0.1.0
servers:
  - url: https://ai.xbrod.com
    description: 本项目线上 API 网关
security:
  - bearerAuth: []
paths:
  /v1/images/generations:
    post:
      summary: Gemini 3 Pro Image 图像生成
      description: 使用当前模型发起生成请求。
      operationId: generate_gemini_3_pro_image_preview
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  enum:
                    - gemini-3-pro-image
                  description: 对外请求的模型 ID
                prompt:
                  type: string
                  minLength: 1
                  description: 图片生成或编辑的文字描述；必填
                size:
                  type: string
                  enum:
                    - auto
                    - '1:1'
                    - '2:3'
                    - '3:2'
                    - '3:4'
                    - '4:3'
                    - '4:5'
                    - '5:4'
                    - '9:16'
                    - '16:9'
                    - '21:9'
                  default: auto
                  description: 输出宽高比；图生图建议指定比例
                resolution:
                  type: string
                  enum:
                    - 1K
                    - 2K
                    - 4K
                  default: 1K
                  description: 输出分辨率（当前网关不接受 0.5K）
                'n':
                  type: integer
                  enum:
                    - 1
                  default: 1
                  description: 每次生成 1 张
                image_urls:
                  type: array
                  maxItems: 14
                  items:
                    type: string
                  description: 图像编辑参考图，最多 14 张；每张不超过 30MB；支持公开 URL 或图片 Data URI
                nsfw_check:
                  type: boolean
                  default: false
                  description: 提交前进行内容审核；默认为 false
                official_fallback:
                  type: boolean
                  default: false
                  description: 可选的官方线路回退；可能使用不同计费档位
                response_format:
                  type: string
                  enum:
                    - url
                  description: 本网关仅支持 url 响应格式
              required:
                - model
                - prompt
            example:
              model: gemini-3-pro-image
              prompt: 一张简洁的绿色植物海报，干净背景
              size: '16:9'
              resolution: 1K
      responses:
        '200':
          description: 生成成功，返回图片 URL
          content:
            application/json:
              schema:
                type: object
                properties:
                  created:
                    type: integer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                          format: uri
              example:
                created: 1
                data:
                  - url: https://example.com/result.png
        '504':
          description: 图片等待超时；根据响应中的 task_id 查询原任务，不要重复提交。
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 本项目签发的 API 密钥，不是上游密钥

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.