{
  "openapi": "3.1.0",
  "info": {
    "title": "MiniMax Conch Generation API",
    "version": "1.0.0",
    "description": "Create an asynchronous MiniMax video generation task through CometAPI and poll it later with GET /v1/query/video_generation."
  },
  "servers": [
    {
      "url": "https://api.cometapi.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer token authentication. Use your CometAPI key."
      }
    }
  },
  "paths": {
    "/v1/video_generation": {
      "post": {
        "summary": "Create a MiniMax video task",
        "operationId": "minimax_conch_generation",
        "description": "Start a MiniMax video generation job. The API returns a task id immediately. Query the task until a file id or download URL becomes available.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "prompt"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "MiniMax video model id. `minimax-hailuo-02` is the currently validated CometAPI example model.",
                    "example": "minimax-hailuo-02",
                    "default": "minimax-hailuo-02"
                  },
                  "prompt": {
                    "type": "string",
                    "description": "Prompt text. MiniMax allows long prompts, but short direct prompts are best for first-time integration tests.",
                    "example": "A paper boat floating on calm water at sunrise."
                  },
                  "resolution": {
                    "type": "string",
                    "description": "Output resolution tier, such as `768P`. `512P` is only available when `first_frame_image` is provided; text-only requests must use a higher tier."
                  },
                  "duration": {
                    "type": "integer",
                    "description": "Video length in seconds, such as `6`."
                  },
                  "first_frame_image": {
                    "type": "string",
                    "description": "Optional first-frame image as a public URL or base64 data URI."
                  }
                },
                "default": {
                  "model": "minimax-hailuo-02",
                  "prompt": "A paper boat floating on calm water at sunrise."
                }
              },
              "examples": {
                "Validated request": {
                  "summary": "Text to video",
                  "value": {
                    "model": "minimax-hailuo-02",
                    "prompt": "A paper boat floating on calm water at sunrise.",
                    "duration": 6,
                    "resolution": "768P"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "task_id",
                    "base_resp",
                    "file"
                  ],
                  "properties": {
                    "file": {
                      "type": "object",
                      "properties": {
                        "file_id": {
                          "type": "integer"
                        },
                        "bytes": {
                          "type": "integer"
                        },
                        "created_at": {
                          "type": "integer"
                        },
                        "filename": {
                          "type": "string"
                        },
                        "purpose": {
                          "type": "string"
                        },
                        "download_url": {
                          "type": "string"
                        }
                      }
                    },
                    "task_id": {
                      "type": "string"
                    },
                    "base_resp": {
                      "type": "object",
                      "required": [
                        "status_code",
                        "status_msg"
                      ],
                      "properties": {
                        "status_code": {
                          "type": "integer"
                        },
                        "status_msg": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "example": {
                    "file": {
                      "file_id": 0,
                      "bytes": 0,
                      "created_at": 0,
                      "filename": "",
                      "purpose": "",
                      "download_url": ""
                    },
                    "task_id": "375782873624999",
                    "base_resp": {
                      "status_code": 0,
                      "status_msg": "success"
                    }
                  }
                },
                "example": {
                  "task_id": "<task_id>",
                  "base_resp": {
                    "status_code": 0,
                    "status_msg": "success"
                  },
                  "file": {
                    "file_id": 0,
                    "bytes": 0,
                    "created_at": 0,
                    "filename": "",
                    "purpose": "",
                    "download_url": ""
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "Default",
            "source": "curl https://api.cometapi.com/v1/video_generation \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"minimax-hailuo-02\",\n    \"prompt\": \"A paper boat floating on calm water at sunrise.\",\n    \"duration\": 6,\n    \"resolution\": \"768P\"\n  }'\n"
          },
          {
            "lang": "Python",
            "label": "Default",
            "source": "import os\nimport requests\n\nresponse = requests.post(\n    \"https://api.cometapi.com/v1/video_generation\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"COMETAPI_KEY\"]},\n    json={\n        \"model\": \"minimax-hailuo-02\",\n        \"prompt\": \"A paper boat floating on calm water at sunrise.\",\n        \"duration\": 6,\n        \"resolution\": \"768P\",\n    },\n)\n\ntask = response.json()\nprint(task[\"task_id\"])  # poll GET /v1/query/video_generation?task_id=...\n"
          },
          {
            "lang": "JavaScript",
            "label": "Default",
            "source": "const response = await fetch(\"https://api.cometapi.com/v1/video_generation\", {\n    method: \"POST\",\n    headers: {\n        Authorization: `Bearer ${process.env.COMETAPI_KEY}`,\n        \"Content-Type\": \"application/json\",\n    },\n    body: JSON.stringify({\n        model: \"minimax-hailuo-02\",\n        prompt: \"A paper boat floating on calm water at sunrise.\",\n        duration: 6,\n        resolution: \"768P\",\n    }),\n});\n\nconst task = await response.json();\nconsole.log(task.task_id); // poll GET /v1/query/video_generation?task_id=...\n"
          }
        ]
      }
    }
  }
}
