> ## 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.

# submit-jobs

> Use the Midjourney Imagine API to generate images from prompts



## OpenAPI

````yaml POST /midjourney/v1/submit-jobs
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:
  /midjourney/v1/submit-jobs:
    post:
      description: Use the Midjourney Imagine API to generate images from prompts
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Create'
        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:
    Create:
      required:
        - prompt
      type: object
      properties:
        prompt:
          description: Prompt
          type: string
          example: a boy play with a girl --niji 7
        mode:
          type: string
          example: fast
          description: Speed mode,default fast
          enum:
            - relaxed
            - fast
        hookUrl:
          type: string
          example: https://api.example.com/webhook
          description: Callback notification URL
        timeout:
          type: integer
          example: 600
          description: 'Task timeout unit: seconds, range 300 - 1200, default 600'
    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>.

````