# Edit/Generate Image

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v1/universal/imagine:
    post:
      summary: Edit/Generate Image
      deprecated: false
      description: The API to generate image by Gemini/Nanobanana.
      tags:
        - Image Edit（Nanobanana) API Documentation
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ref:
                  type: string
                  description: >-
                    The reference metadata which will return as part of the
                    webhook.
                  nullable: true
                webhookOverride:
                  type: string
                  description: >-
                    The webhook URL which the response will send to, the payload
                    of this webhook is same as our Message endpoint.
                  default: YOUR_BACKEND_API_ENDPOINT
                  nullable: true
                timeout:
                  type: integer
                  description: Custom timeout, default to 300 in seconds
                  default: 300
                  minimum: 10
                  maximum: 900
                  nullable: true
                model:
                  type: string
                  description: Different flux model to use
                  default: nano-banana
                  enum:
                    - gemini-2.5-flash-image-preview
                    - nano-banana
                    - gemini-3-pro-image-preview
                    - nano-banana-2
                  x-apifox-enum:
                    - value: gemini-2.5-flash-image-preview
                      name: ''
                      description: ''
                    - value: nano-banana
                      name: ''
                      description: ''
                    - value: gemini-3-pro-image-preview
                      name: ''
                      description: ''
                    - value: nano-banana-2
                      name: ''
                      description: ''
                  nullable: true
                contents:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - text
                          - image
                        x-apifox-enum:
                          - value: text
                            name: ''
                            description: ''
                          - value: image
                            name: ''
                            description: ''
                      text:
                        type: string
                      url:
                        type: string
                    x-apifox-orders:
                      - type
                      - text
                      - url
                    required:
                      - type
                      - text
                      - url
                  description: >-
                    The imagine prompt, you can also include an image URL or
                    other valid parameters in it, same like you using Midjourney
                    in Discord.
              x-apifox-orders:
                - contents
                - ref
                - webhookOverride
                - timeout
                - model
              required:
                - contents
            example:
              contents:
                - type: image
                  url: >-
                    https://xxxx.supabase.co/storage/v1/object/public/e428d5d8-94f7-4292-9e53-15ba1bd59740.png
                - type: text
                  text: make her dress in red
              model: nano-banana-2
      responses:
        '200':
          description: >-
            You can use the same approach by
            https://docs.imaginepro.ai/api-215981214, or use webhookOverride to
            get the response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: The status of the request.
                  messageId:
                    type: string
                    description: >-
                      The messageId of the request, which will be used for
                      querying the progress, sending subsequential actions
                      later, etc.
                  createdAt:
                    type: string
                    description: The timestamp of the job creation.
                  error:
                    type: string
                    description: The error message, if any
                x-apifox-orders:
                  - success
                  - messageId
                  - createdAt
                  - error
                required:
                  - success
                  - messageId
                  - createdAt
          headers: {}
          x-apifox-name: Success
      security:
        - bearer: []
      x-apifox-folder: Image Edit（Nanobanana) API Documentation
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/5160896/apis/api-346546864-run
components:
  schemas: {}
  securitySchemes:
    bearerAuth:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://api.imaginepro.ai
    description: Prod Env
security: []

```
