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

# Midjourney Imagine API Documentation

> Use the Midjourney Imagine API to generate images from prompts or references for creative tooling, design workflows, and visual content production.

Start here if you need the main endpoint for **Midjourney API** image generation.

For the complete endpoint directory, workflow guidance, and related links, see the [Midjourney API overview](/api/en/midjourney).


## OpenAPI

````yaml openapi/en/midjourney.json POST /midjourney/v1/imagine
openapi: 3.1.0
info:
  title: TTAPI API DOCS
  version: 1.0.0
  description: Midjourney image generation related endpoints
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /midjourney/v1/imagine:
    post:
      description: Imagine endpoint will generate 4 images based on the prompt
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImagineRequest'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    ImagineRequest:
      type: object
      properties:
        prompt:
          type: string
          example: A cute cat
          description: Prompt
        mode:
          type: string
          example: fast
          description: Speed mode
          enum:
            - relax
            - fast
            - turbo
        timeout:
          type: integer
          example: '300'
          description: 'Task timeout, unit: seconds, range 300 - 1200'
        hookUrl:
          type: string
          description: Callback notification URL
      required:
        - prompt
        - mode
  responses:
    SuccessResponse:
      description: Request successful
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: SUCCESS
              message:
                type: string
                example: success
              data:
                type: object
                example:
                  jobId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            required:
              - status
              - message
              - data
    400Response:
      description: Parameter error
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: '"prompt" cannot be empty.'
              data:
                type: object
            required:
              - status
              - message
    401Response:
      description: Authorization failed
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: Wrong TT-API-KEY or email is not activated.
            required:
              - status
              - message
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        You can obtain your API key from the <a
        href='https://dashboard.ttapi.io' target='_blank'>TTAPI Dashboard</a>.

````