メインコンテンツへスキップ
POST
/
v1
/
videos
/
generations
curl --request POST \
  --url https://api.apimart.ai/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "kling-v3",
    "prompt": "金色の猫が日差しの中の草原を走る、スローモーション、映画的な質感",
    "mode": "std",
    "duration": 5,
    "aspect_ratio": "16:9"
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_xxxxxxxxxx"
    }
  ]
}
curl --request POST \
  --url https://api.apimart.ai/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "kling-v3",
    "prompt": "金色の猫が日差しの中の草原を走る、スローモーション、映画的な質感",
    "mode": "std",
    "duration": 5,
    "aspect_ratio": "16:9"
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_xxxxxxxxxx"
    }
  ]
}

認証

Authorization
string
必須
すべてのAPIエンドポイントはBearer Token認証が必要ですAPIキーの取得:APIキー管理ページにアクセスしてAPIキーを取得してくださいリクエストヘッダーに追加:
Authorization: Bearer YOUR_API_KEY

リクエストパラメータ

model
string
必須
動画生成モデル名サポートされているモデル:
  • kling-v3 - Kling v3(推奨)
prompt
string
必須
テキストプロンプトシーン、アクション、スタイルなどを詳しく記述すると、より良い生成結果が得られます。英語のプロンプトを推奨します。例:"a golden retriever running on the beach, sunset, cinematic"
mode
string
デフォルト:"std"
生成モードオプション:
  • std - スタンダードモード(720P)
  • pro - プロフェッショナルモード(1080P)
デフォルト:std
duration
integer
デフォルト:"5"
動画の長さ(秒)オプション:510、または 15デフォルト:5
15秒はテキストから動画のみサポートします。画像から動画は最大10秒です。
aspect_ratio
string
デフォルト:"16:9"
動画のアスペクト比オプション:
  • 16:9 - 横向き
  • 9:16 - 縦向き
  • 1:1 - 正方形
デフォルト:16:9
negative_prompt
string
ネガティブプロンプト、不要なコンテンツを除外するために使用例:"ぼやけ, 低画質, 歪み"
image_urls
array<url>
画像から動画生成用の画像URL配列
  • 1枚:先頭フレームとして使用
  • 2枚:自動的に先頭フレーム + 末尾フレームに割り当て
最大2枚まで例:["https://example.com/first.jpg"]
  • 最大2枚まで
  • 画像URLは公開アクセス可能で、ホットリンク保護がないものである必要があります
  • 画像から動画モードでは、aspect_ratio が画像の実際の比率で上書きされる場合があります
last_frame_image
string
末尾フレーム画像URL、画像から動画でのみ使用可能image_urls に2枚渡すことでも代替できます
画像から動画モード(image_urls を指定時)でのみ使用可能です。
watermark
boolean
ウォーターマークを追加するかどうか

機能サポートマトリクス

タイプ機能std 5秒std 10秒std 15秒pro 5秒pro 10秒
テキストから動画動画生成
画像から動画動画生成-
画像から動画先頭フレーム-
画像から動画末尾フレーム-
注意:15秒はテキストから動画のみサポートします。画像から動画は最大10秒です。

テキストから動画 vs 画像から動画

image_urls の有無でシステムが自動的にモードを判定します:画像なしはテキストから動画、画像ありは画像から動画。
パラメータテキストから動画画像から動画
prompt✅ 必須✅ 必須
image_urls❌ 不要✅ 必須(1-2枚)
last_frame_image❌ 不要✅ 任意(末尾フレーム)
negative_prompt✅ 任意✅ 任意
mode✅ 任意✅ 任意
duration✅ 任意(5/10/15)✅ 任意(5/10)
aspect_ratio✅ 任意⚠️ 画像比率で上書きされる場合あり
watermark✅ 任意✅ 任意

レスポンス

code
integer
レスポンスステータスコード、成功時は200
data
array
レスポンスデータ配列

使用シーン

シーン 1:テキストから動画(スタンダードモード)

{
  "model": "kling-v3",
  "prompt": "a golden retriever running on the beach, sunset, cinematic",
  "mode": "std",
  "duration": 5,
  "aspect_ratio": "16:9"
}

シーン 2:テキストから動画(プロモード + ネガティブプロンプト)

{
  "model": "kling-v3",
  "prompt": "Tokyo Shibuya crossing, rainy night with neon lights reflecting on wet ground, pedestrians with umbrellas",
  "negative_prompt": "ぼやけ, 低画質, 歪み",
  "mode": "pro",
  "duration": 10,
  "aspect_ratio": "16:9"
}

シーン 3:テキストから動画(15秒)

{
  "model": "kling-v3",
  "prompt": "a time-lapse of a flower blooming in a garden",
  "duration": 15,
  "aspect_ratio": "16:9"
}

シーン 4:画像から動画(先頭フレーム)

{
  "model": "kling-v3",
  "prompt": "the cat slowly walks forward and looks around",
  "image_urls": ["https://example.com/cat.jpg"],
  "mode": "std",
  "duration": 5
}

シーン 5:画像から動画(先頭 + 末尾フレーム制御)

{
  "model": "kling-v3",
  "prompt": "smooth cinematic transition",
  "image_urls": ["https://example.com/frame-start.jpg"],
  "last_frame_image": "https://example.com/frame-end.jpg",
  "mode": "std",
  "duration": 5
}
image_urls に2枚渡すと、2枚目が自動的に末尾フレームとして使用されます:
{
  "model": "kling-v3",
  "prompt": "smooth cinematic transition",
  "image_urls": [
    "https://example.com/frame-start.jpg",
    "https://example.com/frame-end.jpg"
  ]
}
タスク結果の照会動画生成は非同期タスクです。送信後に task_id が返されます。タスクステータスの取得 エンドポイントで生成の進捗と結果を照会できます。