MiniMax H3 テキストから動画
テキストから動画へのエンドポイントを使用して、非同期タスクを作成します。
概要
サポートされているモデルでテキストから動画へのエンドポイントを使用します。返されたタスクIDを使用してその状態を取得するか、以下に記載されている配信のために callback_url を指定してください。
クイックスタート
- APIキーを作成し、RUNAPI_API_KEYとして設定します。
- サポートされているモデルを選択し、そのモデルのスキーマに一致するボディを持つPOSTリクエストを送信します。
- 返されたタスクIDを保存し、終了状態になるまでポーリングするか、以下に記載されているコールバックを処理してください。
エンドポイント
- ベースURL
https://runapi.ai- API バージョン
v1- 認証
Authorization: Bearer YOUR_API_TOKEN
サポートされているモデル
現在の料金、レート制限、商用利用の詳細については、モデルページを開いてください。
リクエストスキーマ
フィールドと許可される値は選択したモデルによって異なります。指定した場合、callback_urlは以下に記載されたTask配信を受信します。
minimax-h3フィールド9件
aspect_ratiostring生成される動画のアスペクト比。adaptive はリファレンスメディアがある場合にのみ利用可能です。
許可される値:adaptive, 21:9, 16:9, 4:3, 1:1, 3:4, 9:16
callback_urlstring非同期通知用のWebhook URL。
duration_secondsinteger生成される動画の長さ(秒単位)。
許可される値:4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
デフォルト: 6
modelstringモデルスラッグ。
output_resolutionstring生成される動画の解像度。
許可される値:768p, 2k
デフォルト: 2k
promptstring動画生成プロンプト。
範囲:1 - 7000
reference_audio_urlsarray公開 HTTP(S) の WAV または MP3 参照音声 URL。参照画像または動画が必要で、各クリップは 2〜15 秒、結合後の音声時間は 15 秒以内にする必要があります。
項目数の上限:3
reference_image_urlsarray公開 HTTP(S) の参照画像 URL。JPG、JPEG、PNG、WEBP、HEIC、または HEIF 形式で、各最大 30 MB、1 辺 256〜5760 ピクセル、アスペクト比 0.4〜2.5。
項目数の上限:9
reference_video_urlsarray公開 HTTP(S) の MP4 または MOV 参照動画 URL。各クリップは 2〜15 秒で、結合後の動画時間は 15 秒以内にする必要があります。
項目数の上限:3
条件付きルール
これらの要件は、列挙されたすべての条件が一致する場合に適用されます。
-
条件
reference_audio_urls = {"present" => true}- 必須
- 使用不可
-
条件
reference_image_urls = {"present" => false},reference_video_urls = {"present" => false}- 必須
aspect_ratio- 使用不可
承認を作成する
POST /api/v1/minimax_h3/text_to_video
レスポンススキーマ
{
"properties": {
"billing": {
"properties": {
"refund": {
"oneOf": [
{
"properties": {
"refunded_at": {
"type": "string"
}
},
"required": [
"refunded_at"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"reservation": {
"oneOf": [
{
"properties": {
"amount_cents": {
"type": "integer"
}
},
"required": [
"amount_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"settlement": {
"oneOf": [
{
"properties": {
"amount_micro_cents": {
"type": "integer"
},
"charged_amount_cents": {
"type": "integer"
}
},
"required": [
"charged_amount_cents",
"amount_micro_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
}
},
"required": [
"reservation",
"settlement",
"refund"
],
"type": "object",
"unevaluatedProperties": false
},
"id": {
"type": "string"
},
"status": {
"enum": [
"processing"
],
"type": "string"
},
"task_replayed": {
"type": "boolean"
}
},
"required": [
"id",
"status",
"billing"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "processing"
}
ポーリング処理中
GET /api/v1/minimax_h3/text_to_video/:id
レスポンススキーマ
{
"properties": {
"billing": {
"properties": {
"refund": {
"oneOf": [
{
"properties": {
"refunded_at": {
"type": "string"
}
},
"required": [
"refunded_at"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"reservation": {
"oneOf": [
{
"properties": {
"amount_cents": {
"type": "integer"
}
},
"required": [
"amount_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"settlement": {
"oneOf": [
{
"properties": {
"amount_micro_cents": {
"type": "integer"
},
"charged_amount_cents": {
"type": "integer"
}
},
"required": [
"charged_amount_cents",
"amount_micro_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
}
},
"required": [
"reservation",
"settlement",
"refund"
],
"type": "object",
"unevaluatedProperties": false
},
"id": {
"type": "string"
},
"status": {
"enum": [
"processing"
],
"type": "string"
}
},
"required": [
"id",
"status",
"billing"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "processing"
}
ポーリング完了
GET /api/v1/minimax_h3/text_to_video/:id
レスポンススキーマ
{
"properties": {
"billing": {
"properties": {
"refund": {
"oneOf": [
{
"properties": {
"refunded_at": {
"type": "string"
}
},
"required": [
"refunded_at"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"reservation": {
"oneOf": [
{
"properties": {
"amount_cents": {
"type": "integer"
}
},
"required": [
"amount_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"settlement": {
"oneOf": [
{
"properties": {
"amount_micro_cents": {
"type": "integer"
},
"charged_amount_cents": {
"type": "integer"
}
},
"required": [
"charged_amount_cents",
"amount_micro_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
}
},
"required": [
"reservation",
"settlement",
"refund"
],
"type": "object",
"unevaluatedProperties": false
},
"id": {
"type": "string"
},
"status": {
"enum": [
"completed"
],
"type": "string"
},
"videos": {
"items": {
"properties": {
"url": {
"type": "string",
"x-runapi-generated-media": true
}
},
"required": [
"url"
],
"type": "object",
"unevaluatedProperties": false
},
"type": "array"
}
},
"required": [
"id",
"status",
"videos",
"billing"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "completed",
"videos": [
{
"url": "https://file.runapi.ai/reference-video.mp4"
}
]
}
ポーリング失敗
GET /api/v1/minimax_h3/text_to_video/:id
レスポンススキーマ
{
"properties": {
"billing": {
"properties": {
"refund": {
"oneOf": [
{
"properties": {
"refunded_at": {
"type": "string"
}
},
"required": [
"refunded_at"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"reservation": {
"oneOf": [
{
"properties": {
"amount_cents": {
"type": "integer"
}
},
"required": [
"amount_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"settlement": {
"oneOf": [
{
"properties": {
"amount_micro_cents": {
"type": "integer"
},
"charged_amount_cents": {
"type": "integer"
}
},
"required": [
"charged_amount_cents",
"amount_micro_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
}
},
"required": [
"reservation",
"settlement",
"refund"
],
"type": "object",
"unevaluatedProperties": false
},
"error": {
"type": "string"
},
"id": {
"type": "string"
},
"status": {
"enum": [
"failed"
],
"type": "string"
}
},
"required": [
"id",
"status",
"error",
"billing"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"error": "Task processing failed.",
"id": "tsk_reference_demo",
"status": "failed"
}
顧客コールバック: 完了
POST callback_url
レスポンススキーマ
{
"properties": {
"id": {
"type": "string"
},
"status": {
"enum": [
"completed"
],
"type": "string"
},
"videos": {
"items": {
"properties": {
"url": {
"type": "string",
"x-runapi-generated-media": true
}
},
"required": [
"url"
],
"type": "object",
"unevaluatedProperties": false
},
"type": "array"
}
},
"required": [
"id",
"status",
"videos"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"id": "tsk_reference_demo",
"status": "completed",
"videos": [
{
"url": "https://file.runapi.ai/reference-video.mp4"
}
]
}
顧客コールバック: 失敗
POST callback_url
レスポンススキーマ
{
"properties": {
"error": {
"oneOf": [
{
"type": "string"
},
{
"properties": {
"code": {
"type": "string"
},
"limit_cents": {
"type": "integer"
},
"message": {
"type": "string"
},
"reset_at": {
"format": "date-time",
"type": [
"string",
"null"
]
},
"used_cents": {
"type": "integer"
},
"window": {
"enum": [
"1h",
"1d",
"7d",
"daily",
"weekly",
"monthly",
"lifetime"
],
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"unevaluatedProperties": false
}
]
},
"id": {
"type": "string"
},
"status": {
"enum": [
"failed"
],
"type": "string"
}
},
"required": [
"id",
"status",
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": {
"code": "generation_failed",
"message": "Task processing failed."
},
"id": "tsk_reference_demo",
"status": "failed"
}
エラー
POST /api/v1/minimax_h3/text_to_video
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "Authentication required"
}
エラー
GET /api/v1/minimax_h3/text_to_video/:id
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "Authentication required"
}
エラー
POST /api/v1/minimax_h3/text_to_video
レスポンススキーマ
{
"oneOf": [
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
},
{
"properties": {
"error": {
"description": "人間が読める形式のバリデーションサマリー。",
"type": "string"
},
"errors": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "公開リクエストフィールドをキーとするバリデーションメッセージ。各フィールドに対して人間が読める文字列の配列が含まれます。",
"type": "object"
}
},
"required": [
"error",
"errors"
],
"type": "object",
"unevaluatedProperties": false
}
]
}
レスポンス例
{
"error": "model must be one of: minimax-h3"
}
エラー
POST /api/v1/minimax_h3/text_to_video
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "Insufficient balance"
}
エラー
POST /api/v1/minimax_h3/text_to_video
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "API key credit limit exceeded"
}
エラー
POST /api/v1/minimax_h3/text_to_video
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "The request uses features that are not supported for the selected model"
}
エラー
POST /api/v1/minimax_h3/text_to_video
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "Rate limit reached. Please retry later."
}
エラー
POST /api/v1/minimax_h3/text_to_video
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "Service under maintenance, please try again later"
}
エラー
POST /api/v1/minimax_h3/text_to_video
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "The request timed out"
}
エラー
GET /api/v1/minimax_h3/text_to_video/:id
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "Task with id 'tsk_reference_demo' not found"
}
生成されたコードサンプル
cURLを直接使用するか、お使いの言語向けのSDKをインストールしてください。各サンプルは、このリファレンスに示されたバリデーション済みリクエストを送信します。
インストール
pip install runapi-minimax-h3
import os
from runapi.minimax_h3 import MiniMaxH3Client
client = MiniMaxH3Client(api_key=os.environ["RUNAPI_API_KEY"])
task = client.text_to_video.create(
model="minimax-h3",
prompt="A slow aerial view of a quiet coastline at sunrise.",
aspect_ratio="16:9"
)