> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aiairouter.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.aiairouter.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<br />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<br />- Unit: seconds<br />- Range: 300 - 1200<br />-
            Default: 600
    CommonRes:
      required:
        - status
        - data
      type: object
      properties:
        status:
          description: >-
            Status code:<br />- 0: success<br />- 1001: quota not enough<br />-
            1002: concurrency limit, max 30
          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://aiairouter.com/dashboard' target='_blank'>Midjourney-api
        Dashboard</a>.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.