# Generate Image

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v1/flux/imagine:
    post:
      summary: Generate Image
      deprecated: false
      description: >-
        The API to generate your image, in FLUX 1.1 PRO.


        Note:


        If n > 1, the `images` fields in the completed response will have all
        the generated images.


        The `uri` field in the completed response is the first image's URL.
      tags:
        - FLUX API Documentation
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  description: >-
                    The imagine prompt, you can also include an image URL or
                    other valid parameters in it, same like you using Midjourney
                    in Discord.
                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 900 in seconds
                  default: 900
                  minimum: 10
                  maximum: 900
                  nullable: true
                'n':
                  type: integer
                  description: >-
                    How many images to be generated, default is 1, and maximum
                    to 4
                  default: 1
                  minimum: 1
                  maximum: 4
                  nullable: true
                height:
                  type: integer
                  description: Image height, default to 1024, must be divided by 8
                  default: 1024
                  nullable: true
                width:
                  type: integer
                  description: Image width, default to 1024, must be divided by 8
                  default: 1024
                  nullable: true
                aspect_ratio:
                  type: string
                  description: Aspect ratio of the image, default to 1:1
                  default: '1:1'
                  nullable: true
                output_format:
                  type: string
                  description: >-
                    Image type, default to png, try to use webp to reduce size a
                    lot
                  default: png
                  nullable: true
                output_quality:
                  type: string
                  description: Image quality, default to 100
                  default: '100'
                  nullable: true
                model:
                  type: string
                  description: Different flux model to use,  default to `flux-1.1-pro`
                  default: flux-1.1-pro
                  enum:
                    - flux-kontext-pro
                    - flux-1.1-pro
                    - flux-1.1-pro-ultra
                    - flux-kontext-max
                  x-apifox-enum:
                    - value: flux-kontext-pro
                      name: ''
                      description: ''
                    - value: flux-1.1-pro
                      name: ''
                      description: ''
                    - value: flux-1.1-pro-ultra
                      name: ''
                      description: ''
                    - value: flux-kontext-max
                      name: ''
                      description: ''
                  nullable: true
              x-apifox-orders:
                - prompt
                - ref
                - webhookOverride
                - timeout
                - 'n'
                - height
                - width
                - aspect_ratio
                - output_format
                - output_quality
                - model
              required:
                - prompt
            examples: {}
      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
              example:
                success: true
                messageId: d15c1541-229a-442b-9873-d3494dede12a
                createdAt: '2023-08-01T14:03:01.817Z'
          headers: {}
          x-apifox-name: Success
      security:
        - bearer: []
      x-apifox-folder: FLUX API Documentation
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/5160896/apis/api-260043793-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: []

```
