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

# 生成图像 (Pro)

> 使用 nano-banana-pro 模型提交 NanoBanana Pro 图像生成任务。

### 重要说明

* 响应中返回的任务 ID 用于通过获取任务详情接口查询任务状态
* 回调 URL 通知会在任务完成时立即发送


## OpenAPI

````yaml cn/nanobanana-api/nanobanana-api-cn.json post /api/v1/nanobanana/generate-pro
openapi: 3.0.0
info:
  title: NanoBanana API
  description: NanoBanana API 文档 - 图像生成和编辑 API
  version: 1.0.0
  contact:
    name: 技术支持
    email: support@nanobananaapi.ai
servers:
  - url: https://api.nanobananaapi.ai
    description: API 服务器
security:
  - BearerAuth: []
paths:
  /api/v1/nanobanana/generate-pro:
    post:
      summary: 生成图像 (Pro)
      description: |-
        使用 nano-banana-pro 模型提交 NanoBanana Pro 图像生成任务。

        ### 模型信息
        nano-banana-pro 模型支持：
        - 高质量文本到图像生成
        - 图像到图像转换
        - 多种宽高比和分辨率
        - 批量图像处理（最多支持 10 张输入图像）
      operationId: generate-image-pro
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  description: 您想要生成的图像的文本描述
                  example: A cute cat is eating.
                imageUrls:
                  type: array
                  items:
                    type: string
                    format: uri
                  maxItems: 8
                  description: 用于转换或作为参考的输入图像（最多支持 8 张图像）
                  example:
                    - ''
                resolution:
                  type: string
                  enum:
                    - 1K
                    - 2K
                    - 4K
                  description: 生成图像的分辨率
                  example: 2K
                callBackUrl:
                  type: string
                  format: uri
                  description: 回调地址，用于接收任务完成通知（必填）
                  example: https://example-callback.com
                aspectRatio:
                  type: string
                  enum:
                    - '1:1'
                    - '2:3'
                    - '3:2'
                    - '3:4'
                    - '4:3'
                    - '4:5'
                    - '5:4'
                    - '9:16'
                    - '16:9'
                    - '21:9'
                    - auto
                  description: 生成图像的宽高比
                  example: '16:9'
              required:
                - prompt
              example:
                prompt: A cute cat is eating.
                imageUrls:
                  - ''
                resolution: 2K
                callBackUrl: https://example-callback.com
                aspectRatio: '16:9'
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: 响应状态码
                    example: 200
                  message:
                    type: string
                    description: 响应消息
                    example: success
                  data:
                    type: object
                    properties:
                      taskId:
                        type: string
                        description: 用于查询任务状态的任务 ID
                        example: task_12345678
              example:
                code: 200
                message: success
                data:
                  taskId: task_12345678
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |-
        所有 API 都需要通过 Bearer Token 进行身份验证。

        获取 API Key：
        1. 访问 [API Key 管理页面](https://nanobananaapi.ai/api-key) 获取您的 API Key

        使用方法：
        在请求头中添加：
        Authorization: Bearer YOUR_API_KEY

        注意：
        - 请保护您的 API Key 安全，不要与他人分享
        - 如果您怀疑 API Key 已泄露，请立即在管理页面重置

````