# HappyHorse 1.1 動画編集 > Happy Horse 1.1 Video Editは、自然言語の指示で既存動画を編集します。出力解像度は720p/1080pから選択できます。 ## 概要 - **エンドポイント**: `POST https://api.muapi.ai/api/v1/happy-horse-1.1-video-edit` - **モデルID**: `happy-horse-1.1-video-edit` - **カテゴリー**: 動画編集 - **バリアント**: Video Edit - **ファミリー**: happy-horse-1.1 - **費用**: 1回あたり 0.7 クレジット(パラメータにより動的計算されるモデルもあります) ## API利用方法 MuApiは**送信後ポーリング(submit-then-poll)**パターンを採用しています。タスクを送信して`request_id`を取得し、ステータスが`completed`になるまで予測エンドポイントをポーリングします。送信時に`?webhook=YOUR_URL`を指定すると完了時にPOSTコールバックを受け取れます(ポーリング不要)。 **認証**: `x-api-key`ヘッダーにMuApiキーを送信してください。取得先: https://muapi.ai/access-keys ### 1. タスクの送信 ```http POST https://api.muapi.ai/api/v1/happy-horse-1.1-video-edit Content-Type: application/json x-api-key: YOUR_API_KEY ``` **最小構成(必須パラメータのみ):** ```json { "prompt": "", "video_url": "https://example.com/your-video_url" } ``` **完全な例(全パラメータ):** ```json { "prompt": "", "resolution": "720p", "video_url": "https://example.com/your-video_url", "images_list": "https://d3adwkbyhxyrtq.cloudfront.net/webassets/videomodels/happy-horse-1-video-edit-1080p-1.jpg", "audio_setting": "auto", "seed": 0 } ``` **レスポンス:** ```json { "request_id": "abc123", "status": "processing" } ``` ### 2. 結果のポーリング ```http GET https://api.muapi.ai/api/v1/predictions/{request_id}/result x-api-key: YOUR_API_KEY ``` 指定可能な`status`値: `queued`, `pending`, `processing`, `completed`, `failed`, `cancelled`。完了するまで2〜5秒ごとにポーリングしてください。`completed`になると`outputs`配列に生成URLが格納されます。 **`completed`時のレスポンス例:** ```json { "id": "abc123", "status": "completed", "outputs": [ "https://cdn.muapi.ai/.../output.png" ], "urls": { "get": "https://api.muapi.ai/api/v1/predictions/abc123/result" }, "created_at": "2026-05-08T12:34:56Z", "has_nsfw_contents": [] } ``` ### cURL ```bash 1. 送信 REQUEST_ID=$(curl -s -X POST https://api.muapi.ai/api/v1/happy-horse-1.1-video-edit \ -H "x-api-key: $MUAPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt":"","video_url":"https://example.com/your-video_url"}' | jq -r .request_id) 2. 完了までポーリング while :; do RESP=$(curl -s https://api.muapi.ai/api/v1/predictions/$REQUEST_ID/result -H "x-api-key: $MUAPI_API_KEY") STATUS=$(echo "$RESP" | jq -r .status) [ "$STATUS" = "completed" ] && echo "$RESP" | jq .outputs && break [ "$STATUS" = "failed" ] && echo "$RESP" && exit 1 sleep 3 done ``` ### Python ```python import os, time, requests API = "https://api.muapi.ai/api/v1" headers = {"x-api-key": os.environ["MUAPI_API_KEY"]} r = requests.post(f"{API}/happy-horse-1.1-video-edit", headers=headers, json={"prompt":"","video_url":"https://example.com/your-video_url"}) request_id = r.json()["request_id"] while True: res = requests.get(f"{API}/predictions/{request_id}/result", headers=headers).json() if res["status"] == "completed": print(res["outputs"]); break if res["status"] == "failed": raise RuntimeError(res.get("error")); time.sleep(3) ``` ## 入力スキーマ APIは以下の入力パラメータを受け付けます: - **`prompt`** (`string`, _必須_): 生成プロセスを適切に制御するためのパラメータ設定(Edit instruction describing the change to apply to)。 - **`resolution`** (`string`, _任意_): Output resolution. Price scales with resolution: 720p is cheaper, 1080p is more expensive. - デフォルト: `"720p"` - 選択肢: `"720p"`, `"1080p"` - **`video_url`** (`string`, _必須_): 出力動画のフレームレート(秒あたりのフレーム数)。 - **`images_list`** (`array`, _任意_): Optional 0-5 reference image URLs to guide the edit. - **`audio_setting`** (`string`, _任意_): 生成プロセスを適切に制御するためのパラメータ設定(Audio strategy: 'auto' lets the model decide, 'ori)。 - デフォルト: `"auto"` - 選択肢: `"auto"`, `"origin"` - **`seed`** (`int`, _任意_): 生成の再現性を保つためのランダムシード値。同じ値を使用すると同じ結果が得られます。 - デフォルト: `0` ## 出力スキーマ ポーリングエンドポイントは以下のフィールドを返します: - **`id`** (`string`): リクエストID。 - **`status`** (`string`): `queued`, `pending`, `processing`, `completed`, `failed`, `cancelled`のいずれか。 - **`outputs`** (`array`): 生成された画像・動画・音声のURL。`status`が`completed`になるまでは空配列です。 - **`urls.get`** (`string`): この予測結果を再取得するためのセルフリンク。 - **`error`** (`string` | `null`): `status`が`failed`の場合のエラーメッセージ。 - **`created_at`** (`string`): リクエスト作成日時のISO-8601タイムスタンプ。 - **`has_nsfw_contents`** (`array of boolean`): 出力ごとのNSFW検出フラグ。 ## Webhook(任意) 送信先URLに`?webhook=https://your-server/path`を追加してください。タスクが完了状態に達すると、MuApiはポーリングレスポンスと同じ形式を対象URLにPOST送信します(ポーリング不要)。 ## エージェント連携 MuApiはMCPサーバーとCLIを提供しており、エージェント(Claude Code、Cursor、カスタムエージェント等)がHTTPコードを書かずにこのエンドポイントを呼び出せます: ```bash # CLIのインストール npm install -g muapi-cli # 初回認証 muapi auth login # すべてのMuApiモデルをMCPツールとしてエージェントに公開 muapi mcp serve ``` MCPサーバーは`happy-horse-1.1-video-edit`を含むすべてのモデルの送信+ポーリングをラップしたツールを公開します。カテゴリー別のショートカットについては`muapi --help`を参照してください(`muapi image generate`、`muapi video from-image`など)。 ## 関連モデル - [Video Edit](https://muapi.ai/ja/playground/happy-horse-1.1-video-edit) - [Text to Video](https://muapi.ai/ja/playground/happy-horse-1.1-text-to-video-1080p) - [Reference to Video](https://muapi.ai/ja/playground/happy-horse-1.1-reference-to-video-1080p) - [Reference to Video](https://muapi.ai/ja/playground/happy-horse-1.1-reference-to-video-720p) - [Video Edit](https://muapi.ai/ja/playground/happy-horse-1.1-video-edit-720p) - [Image to Video](https://muapi.ai/ja/playground/happy-horse-1.1-image-to-video-1080p) - [Text to Video](https://muapi.ai/ja/playground/happy-horse-1.1-text-to-video-720p) - [Image to Video](https://muapi.ai/ja/playground/happy-horse-1.1-image-to-video-720p) - [Video Edit](https://muapi.ai/ja/playground/happy-horse-1.1-video-edit-1080p) - [Text to Video](https://muapi.ai/ja/playground/happy-horse-1.1-text-to-video) - [Image to Video](https://muapi.ai/ja/playground/happy-horse-1.1-image-to-video) - [Reference to Video](https://muapi.ai/ja/playground/happy-horse-1.1-reference-to-video) ## リソース - [Playgroundページ](https://muapi.ai/ja/playground/happy-horse-1.1-video-edit) - [APIリファレンス](https://muapi.ai/ja/playground/happy-horse-1.1-video-edit/api) - [全体llms.txt](https://muapi.ai/ja/llms.txt)