{
  "openapi": "3.1.0",
  "info": {
    "title": "SeedRouter MiniMax H3",
    "version": "1.0.0",
    "description": "MiniMax H3 video with generated audio from text, frames or references, in MiniMax's official request format. Asynchronous task delivery; media by URL only; callbacks are not offered; tasks cannot be cancelled."
  },
  "servers": [
    {
      "url": "https://api.seedrouter.ai/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/videos/generations": {
      "post": {
        "summary": "Create a video generation task",
        "operationId": "createVideoTask",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted. Poll the returned id; no video is returned by this call.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/tasks/{task_id}": {
      "get": {
        "summary": "Read an owned image task",
        "operationId": "getImageTask",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^task_[A-Za-z0-9]{1,64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Processing, completed or failed task. Polling timeout is not a task failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "401": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "VideoRequest": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "minimax-h3"
            ]
          },
          "content": {
            "minItems": 1,
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "text"
                    },
                    "text": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "text"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "image_url"
                    },
                    "image_url": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string",
                          "format": "uri"
                        }
                      },
                      "required": [
                        "url"
                      ],
                      "additionalProperties": false
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "first_frame",
                        "last_frame",
                        "reference_image"
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "image_url"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "video_url"
                    },
                    "video_url": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string",
                          "format": "uri"
                        }
                      },
                      "required": [
                        "url"
                      ],
                      "additionalProperties": false
                    },
                    "role": {
                      "type": "string",
                      "const": "reference_video"
                    }
                  },
                  "required": [
                    "type",
                    "video_url"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "audio_url"
                    },
                    "audio_url": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string",
                          "format": "uri"
                        }
                      },
                      "required": [
                        "url"
                      ],
                      "additionalProperties": false
                    },
                    "role": {
                      "type": "string",
                      "const": "reference_audio"
                    }
                  },
                  "required": [
                    "type",
                    "audio_url"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "description": "Exactly one non-empty text item (up to 7000 characters), plus either a first_frame and/or last_frame image, or up to 9 reference_image, 3 reference_video and 3 reference_audio items; frames and references cannot be combined. A single image without a role is the first frame. Media are public http(s) URLs; base64 and mm_file ids are not accepted."
          },
          "resolution": {
            "type": "string",
            "enum": [
              "768P",
              "2K"
            ],
            "description": "Required. 768P or 2K."
          },
          "duration": {
            "type": "integer",
            "minimum": 4,
            "maximum": 15,
            "description": "Required. 4–15 seconds."
          },
          "ratio": {
            "type": "string",
            "enum": [
              "21:9",
              "16:9",
              "4:3",
              "1:1",
              "3:4",
              "9:16",
              "adaptive"
            ],
            "description": "Required for text alone, where adaptive is not accepted. With frames the image sets the shape (any value is treated as adaptive); with references it defaults to adaptive."
          },
          "content_filter": {
            "type": "boolean",
            "default": true,
            "description": "SeedRouter content filter (not sent to the model): the text, images and first/middle/last frames of reference videos are checked before generation; a flagged or uncheckable request fails without charge."
          }
        },
        "required": [
          "model",
          "content",
          "resolution",
          "duration"
        ],
        "additionalProperties": false
      },
      "TaskAccepted": {
        "type": "object",
        "required": [
          "id",
          "model",
          "status",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "model": {
            "enum": [
              "minimax-h3"
            ]
          },
          "status": {
            "const": "processing"
          },
          "created_at": {
            "type": "integer"
          }
        }
      },
      "Task": {
        "type": "object",
        "required": [
          "id",
          "model",
          "status",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "model": {
            "enum": [
              "minimax-h3"
            ]
          },
          "status": {
            "enum": [
              "processing",
              "completed",
              "failed"
            ]
          },
          "created_at": {
            "type": "integer"
          },
          "finished_at": {
            "type": "integer"
          },
          "output": {
            "type": "object",
            "properties": {
              "video_url": {
                "type": "string",
                "format": "uri"
              },
              "resolution": {
                "enum": [
                  "768P",
                  "2K"
                ]
              },
              "ratio": {
                "type": "string",
                "description": "The aspect ratio the clip was made at, including the one chosen for adaptive."
              },
              "duration": {
                "type": "integer"
              }
            }
          },
          "error": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              10001,
              10002,
              20001,
              20002,
              30001,
              30002,
              50001,
              50002,
              50003,
              60001,
              60002,
              60003,
              60004,
              90001
            ]
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
