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

# GPT-Image

> Generate images based on text prompts and image resources 



## OpenAPI

````yaml POST /gpt/v1/generations
openapi: 3.1.0
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.midjourney-api.com
security:
  - CustomApiKey: []
paths:
  /gpt/v1/generations:
    post:
      description: 'Generate images based on text prompts and image resources '
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GptCreate'
        required: true
      responses:
        '200':
          description: Request successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommonRes'
        '400':
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - CustomApiKey: []
components:
  schemas:
    GptCreate:
      required:
        - prompt
      type: object
      properties:
        prompt:
          description: >-
            Text prompt for image generation. Since this is a reverse-engineered
            model, it's recommended to include keywords in your prompt such as:
            "draw a xxx", "generate a", 'draw a xxx', Language is not
            restricted; OpenAI itself supports multilingual models with
            excellent Chinese support.
          type: string
          example: draw a boy play with a girl
        model:
          type: string
          example: gpt-image-2
          description: 'Supported models: gpt-image-2'
          enum:
            - gpt-image-2
        referImages:
          type: array
          example:
            - https://example.com/image.png
            - https://example.com/image.png
          description: Reference image array
          items:
            type: string
        aspect_ratio:
          type: string
          example: '1:1'
          description: >-
            Support model: gpt-image-2; Available options: 1:1, 3:4, 4:3, 16:9,
            9:16
          enum:
            - '1:1'
            - '3:4'
            - '4:3'
            - '16:9'
            - '9:16'
        hookUrl:
          type: string
          example: https://api.example.com/webhook
          description: Callback notification URL
    CommonRes:
      required:
        - status
        - data
      type: object
      properties:
        status:
          description: >-
            Status code, 0: success; 1001: quota not enough，1002 concurrency
            limit, max 10
          type: integer
          example: 0
        message:
          description: Message
          type: string
          example: success
        data:
          type: object
          properties:
            taskId:
              type: string
              example: MtAd7mCuc4YqK_a1iAQSW
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
          example: 1001
        message:
          type: string
          example: quota not enough
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: API-KEY
      description: >-
        You can obtain your API key from the <a
        href='https://midjourney-api.com/dashboard'
        target='_blank'>Midjourney-api Dashboard</a>.

````