curl --request POST \
--url https://api.evolink.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "magi-2-reference-to-video",
"prompt": "参照動画のカメラワークとリズムに合わせて、画像のキャラクターが街のビルの屋上で踊る。参照音声のビートに同期させる",
"image_urls": [
"https://example.com/character.jpg"
],
"video_urls": [
"https://example.com/reference.mp4"
],
"audio_urls": [
"https://example.com/bgm.mp3"
],
"duration": 10,
"quality": "1080p",
"aspect_ratio": "16:9",
"generate_audio": true
}
'
{
"created": 1761313744,
"id": "task-unified-1774857405-abc123",
"model": "magi-2-reference-to-video",
"object": "video.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": false,
"estimated_time": 165,
"video_duration": 8
},
"type": "video",
"usage": {
"billing_rule": "per_second",
"credits_reserved": 50
}
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota"
}
}{
"error": {
"code": "model_access_denied",
"message": "Token does not have access to model: magi-2-reference-to-video",
"type": "invalid_request_error"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"type": "api_error"
}
}MAGI-2
MAGI-2 Reference-to-Video マルチモーダル参照動画生成
- 参照画像(0〜10枚)+ 参照動画(0〜5本)+ 参照音声(0〜5本)+ テキストプロンプトで動画を生成
- 3種類の参照素材のうち少なくとも1つが必要で、自由に組み合わせ可能
- 非同期処理モード。返却されたタスクIDで照会してください
- 生成された動画リンクの有効期限は7日間です。お早めに保存してください
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://api.evolink.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "magi-2-reference-to-video",
"prompt": "参照動画のカメラワークとリズムに合わせて、画像のキャラクターが街のビルの屋上で踊る。参照音声のビートに同期させる",
"image_urls": [
"https://example.com/character.jpg"
],
"video_urls": [
"https://example.com/reference.mp4"
],
"audio_urls": [
"https://example.com/bgm.mp3"
],
"duration": 10,
"quality": "1080p",
"aspect_ratio": "16:9",
"generate_audio": true
}
'
{
"created": 1761313744,
"id": "task-unified-1774857405-abc123",
"model": "magi-2-reference-to-video",
"object": "video.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": false,
"estimated_time": 165,
"video_duration": 8
},
"type": "video",
"usage": {
"billing_rule": "per_second",
"credits_reserved": 50
}
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota"
}
}{
"error": {
"code": "model_access_denied",
"message": "Token does not have access to model: magi-2-reference-to-video",
"type": "invalid_request_error"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"type": "api_error"
}
}承認
##すべてのAPIはBearer Tokenによる認証が必要です##
APIキーの取得:
APIキー管理ページ にアクセスしてAPIキーを取得してください
リクエストヘッダーに以下を追加:
Authorization: Bearer YOUR_API_KEY
ボディ
application/json
参照動画 URL 配列、0〜5 本
役割の説明:
| メディアタイプ | 役割 | 典型的な用途 |
|---|---|---|
| 動画 | reference_video | カメラワーク参照、動作参照、映像スタイル参照 |
動画要件:
- 対応フォーマット:
.mp4、.mov - 1本あたりの動画時間:
2〜30秒、最大5本、全動画の合計時間 ≤30秒 - 1本あたりのサイズ:
200MB以内 - HTTPS URL のみ対応。動画URLはサーバーから直接アクセス可能である必要があります
注意: image_urls、video_urls、audio_urls のうち少なくとも1つを指定する必要があります
Maximum array length:
5例:
["https://example.com/reference.mp4"]
参照音声 URL 配列、0〜5 本
役割の説明:
| メディアタイプ | 役割 | 典型的な用途 |
|---|---|---|
| 音声 | reference_audio | BGM、効果音、音声/セリフ参照 |
音声要件:
- 対応フォーマット:
.wav、.mp3 - 1本あたりの音声時間:
2〜30秒、最大5本、全音声の合計時間 ≤30秒 - 1本あたりのサイズ:
15MB以内 - HTTPS URL のみ対応。音声URLはサーバーから直接アクセス可能である必要があります
注意: image_urls、video_urls、audio_urls のうち少なくとも1つを指定する必要があります
Maximum array length:
5例:
["https://example.com/bgm.mp3"]
タスク完了後の HTTPS コールバックアドレス
コールバックタイミング:
- タスク完了(completed)、失敗(failed)、またはキャンセル(cancelled)時にトリガー
- 課金確認完了後に送信
セキュリティ制限:
- HTTPS プロトコルのみ対応
- プライベートIPアドレスへのコールバックは禁止(127.0.0.1、10.x.x.x、172.16-31.x.x、192.168.x.x など)
- URL の長さは
2048文字以内
コールバックメカニズム:
- タイムアウト:
10秒 - 失敗後最大
3回リトライ(失敗後1/2/4秒でそれぞれリトライ) - コールバックレスポンスボディのフォーマットはタスク照会APIの返却フォーマットと同一
- 2xx ステータスコードを成功とみなし、その他のステータスコードでリトライをトリガー
例:
"https://your-domain.com/webhooks/video-task-completed"
レスポンス
動画生成タスクの作成に成功