メインコンテンツへスキップ
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": "gemini-omni-flash-preview",
    "prompt": "a red apple on a wooden table, short cinematic clip",
    "aspect_ratio": "16:9"
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01KS1H7ZYSJWH1N779S2FSHTKA"
    }
  ]
}
curl --request POST \
  --url https://api.apimart.ai/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gemini-omni-flash-preview",
    "prompt": "a red apple on a wooden table, short cinematic clip",
    "aspect_ratio": "16:9"
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01KS1H7ZYSJWH1N779S2FSHTKA"
    }
  ]
}

認証

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

リクエストパラメータ

model
string
必須
動画生成モデル名。固定値は gemini-omni-flash-preview です。
prompt
string
必須
テキスト指示。テキストから動画の場合はシーンの説明、画像 / 動画から動画の場合は動作 / スタイル / 編集の指示です。
prompt と参照素材(image_urls / video_urls)は 少なくともいずれか一方 を指定してください。
image_urls
array<string>
参照画像。最大 16 枚。各項目は http(s):// URL です。JPEG / PNG に対応しています。複数の被写体(例:「猫 + 毛糸玉」)の場合は複数枚を指定し、それらがどのように相互作用するかを prompt で記述できます。
video_urls
array<string>
参照 / 編集対象の動画。最大 1 本(複数動画の参照には非対応)。http(s):// の直リンク、または data:video/...を指定できます。
参照動画は 1 ~ 24 秒。公式では 3 秒以下 を推奨しています。
aspect_ratio
string
デフォルト:"16:9"
動画のアスペクト比。出力画面の向きを実際に制御します。対応値:
  • 16:9 - 横向き(デフォルト)
  • 9:16 - 縦向き
その他の値は 16:9 として扱われます。
resolution
string
デフォルト:"720p"
動画解像度。現在は 720p のみ対応しています。
extend_from_task_id
string
直前のタスク ID:前回の生成タスクの ** task_id** を指定します。

レスポンス

code
integer
レスポンスステータスコード。成功時は 200 です。
data
array
タスク配列を返します。

タスク結果の照会

動画生成は非同期タスクです。送信後に task_id が返されます。タスクステータス取得 API を使用して生成の進捗と結果を照会します。

成功結果の例

{
  "code": 200,
  "data": {
    "id": "task_01KS1H7ZYSJWH1N779S2FSHTKA",
    "status": "completed",
    "progress": 100,
    "created": 1779246294,
    "completed": 1779246334,
    "actual_time": 40,
    "estimated_time": 60,
    "cost": 1.0,
    "credits_cost": 10,
    "result": {
      "videos": [
        {
          "url": ["https://cdn.example.com/gemini_omni_xxx.mp4"],
          "expires_at": 1779332760
        }
      ]
    }
  }
}

ユースケース

シナリオ 1:テキストから動画

{
  "model": "gemini-omni-flash-preview",
  "prompt": "a blue butterfly landing on a flower, macro, soft light",
  "aspect_ratio": "9:16"
}

シナリオ 2:画像から動画

{
  "model": "gemini-omni-flash-preview",
  "prompt": "turn this drawing into realistic footage, use it only as a motion guide",
  "image_urls": ["https://example.com/sketch.jpg"]
}

シナリオ 3:動画から動画

{
  "model": "gemini-omni-flash-preview",
  "prompt": "when the person touches the mirror, make it ripple like liquid",
  "video_urls": ["https://example.com/clip.mp4"]
}