Hailuo AI / MiniMax Chat Completions API

OpenAI-compatible LLM chat completions.

OpenAPI Specification

hailuo-ai-chat-completions-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Hailuo AI / MiniMax Chat Completions API
  description: 'Documented HTTP APIs for MiniMax''s Hailuo generative video and audio platform. The primary surface is AI video generation (Hailuo models), which follows an asynchronous three-step pattern: create a task (POST /video_generation) to receive a task_id, poll status (GET /query/video_generation) until it returns a file_id, then retrieve the file (GET /files/retrieve) to obtain a temporary download URL for the finished MP4. The same platform also serves text-to-speech (T2A), OpenAI-compatible chat completions, and music generation. All endpoints authenticate with a Bearer API key from the MiniMax console.

    Video generation endpoints, methods, the async task/query/retrieve flow, model names, and core parameters are grounded in MiniMax''s published documentation. Request and response schemas are modeled to reflect the documented fields; treat exact field-level shapes as approximate and reconcile against the live API reference. The text-to-speech, chat-completions, and music-generation request bodies are modeled representative payloads.'
  version: '1.0'
  contact:
    name: MiniMax
    url: https://platform.minimax.io
  x-endpointsModeled: true
  x-endpointsModeledNote: Video generation, query, and file-retrieve endpoints, HTTP methods, model names, and the async workflow are confirmed from live MiniMax docs. Detailed JSON schemas, and the music-generation endpoint payload, are honestly modeled and should be reconciled against the official reference before production use.
servers:
- url: https://api.minimax.io/v1
  description: MiniMax International (global)
- url: https://api-uw.minimax.io/v1
  description: MiniMax International - US West (lower time-to-first-audio for T2A)
- url: https://api.minimaxi.chat/v1
  description: MiniMax Mainland China
security:
- bearerAuth: []
tags:
- name: Chat Completions
  description: OpenAI-compatible LLM chat completions.
paths:
  /chat/completions:
    post:
      operationId: createChatCompletion
      tags:
      - Chat Completions
      summary: Create a chat completion
      description: OpenAI-compatible chat completions served by MiniMax's large language models (the MiniMax-M / abab family). Supports streaming, tool/function calling, and long context.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
      responses:
        '200':
          description: A chat completion response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          example: chat.completion
        created:
          type: integer
        model:
          type: string
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                type: object
                properties:
                  role:
                    type: string
                  content:
                    type: string
              finish_reason:
                type: string
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            completion_tokens:
              type: integer
            total_tokens:
              type: integer
        base_resp:
          $ref: '#/components/schemas/BaseResp'
    ChatCompletionRequest:
      type: object
      required:
      - model
      - messages
      properties:
        model:
          type: string
          description: MiniMax LLM model identifier.
          example: MiniMax-M1
        messages:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                enum:
                - system
                - user
                - assistant
                - tool
              content:
                type: string
        stream:
          type: boolean
          example: false
        temperature:
          type: number
          example: 1.0
        max_tokens:
          type: integer
          example: 1024
        tools:
          type: array
          items:
            type: object
    BaseResp:
      type: object
      description: Standard MiniMax response status wrapper.
      properties:
        status_code:
          type: integer
          description: 0 indicates success; non-zero indicates an error.
          example: 0
        status_msg:
          type: string
          example: success
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BaseResp'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Bearer API key created in the MiniMax platform console under Account Management > API Keys. Passed as `Authorization: Bearer {api_key}`.'