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

# banana generate image

> create a task to generate image



## OpenAPI

````yaml post /ai/gi/image/generate
openapi: 3.1.0
info:
  title: OpenAPI definition
  version: v0
servers:
  - url: https://ai.pmock.com/api
    description: Generated server url
security: []
tags:
  - name: 开放-百度视频生成
    description: 开放-百度视频生成
  - name: 开放-Grok开放接口
    description: 开放-Grok开放接口
  - name: 开放-Gemini开放接口
    description: 开放-Gemini开放接口
  - name: 开放-AI对话开放接口
    description: 开放-AI对话开放接口
  - name: 开放-Sora2开放接口
    description: 开放-Sora2开放接口
  - name: 开放-模型列表接口
    description: 开放-模型列表接口
  - name: 开放-OpenAi开放接口
    description: 开放-OpenAi开放接口
  - name: 开放-业务相关接口
    description: 开放-业务相关接口
  - name: 开放-任务开放接口
    description: 开放-任务开放接口
paths:
  /ai/gi/image/generate:
    post:
      tags:
        - 开放-Gemini开放接口
      summary: banana generate image
      description: create a task to generate image
      operationId: bananaImageGenerate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GeminiBananaImageGenerateDTO'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/RTaskResultVO'
components:
  schemas:
    GeminiBananaImageGenerateDTO:
      type: object
      properties:
        prompt:
          type: string
          description: The prompt words used to generate images
          minLength: 1
        model:
          type: string
          default: nano-banana-fast
          description: The model used to generate images
          enum:
            - nano-banana-fast
            - nano-banana-pro
            - nano-banana-2
          title: nano-banana-fast; nano-banana-pro; nano-banana-2
        resolution:
          type: string
          default: 1K
          description: The resolution used to generate images
          enum:
            - 1K
            - 2K
            - 4K
          title: '1K : 1K; 2K : 2K; 4K : 4K'
        action:
          type: string
          description: >-
            Action type, edit (modify existing image) or generate (create new
            image)
          enum:
            - edit
            - generate
          title: 'edit : 编辑 : edit; generate : 生成 : generate'
        numImages:
          type: integer
          format: int32
          description: only support generate 1 image
          maxLength: 1
        imageUrls:
          type: array
          description: >-
            The image link that needs to be edited. It can be an accessible HTTP
            or HTTPS URL, with each image size not exceeding 10MB. If the action
            is edit, this parameter is required
          items:
            type: string
        aspectRatio:
          type: string
          description: The aspect ratio of the image is 1:1 by default
          enum:
            - '21:9'
            - '1:1'
            - '4:3'
            - '3:2'
            - '2:3'
            - '5:4'
            - '4:5'
            - '3:4'
            - '16:9'
            - '9:16'
            - '1:4'
            - '4:1'
            - '1:8'
            - '8:1'
          title: >-
            21:9 : 21:9; 1:1 : 1:1; 4:3 : 4:3; 3:2 : 3:2; 2:3 : 2:3; 5:4 : 5:4;
            4:5 : 4:5; 3:4 : 3:4; 16:9 : 16:9; 9:16 : 9:16; 1:4 : 1:4; 4:1 :
            4:1; 1:8 : 1:8; 8:1 : 8:1
      required:
        - action
        - numImages
        - prompt
    RTaskResultVO:
      type: object
      description: Unified return structure for response results
      properties:
        code:
          type: integer
          format: int32
          description: Response status code
          example: 200
        message:
          type: string
          description: Response message
        data:
          $ref: '#/components/schemas/TaskResultVO'
          description: Response result
        traceId:
          type: string
          description: Response traceId
    TaskResultVO:
      type: object
      properties:
        taskId:
          type: string
          description: taskId

````