> ## Documentation Index
> Fetch the complete documentation index at: https://docs.toapis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Grok Video 1.5 動画生成

> テキスト, 開始フレーム, または参照画像から動画を生成

> [!NOTE]
>
> 中国本土から利用する場合は, 例の `https://toapis.com` を `https://toapis.cn` に置き換えてください.

`grok-video-1.5` では次の 3 つの入力モードを指定できます. 対応チャネルで有効になっているモードだけが利用できます. 見積もりの取得に成功しても, 生成可能なチャネルがあるとは限りません.

> [!WARNING]
>
> 画像には公開アクセス可能な `http://` または `https://` URL を使ってください. ローカルファイルは先に[画像アップロード API](https://docs.toapis.com/docs/ja/api-reference/uploads/images.md)でアップロードし, base64 は直接送信しないでください. JSON で URL を渡す方式は対応チャネル間で共通に使えます. 一部のチャネルは multipart のバイナリファイルを受け付けません.

## 生成モード

| モード | 入力 |
| - | - |
| `text_to_video` | プロンプトのみ, 画像なし |
| `first_frame_image_to_video` | 開始フレーム 1 枚 |
| `reference_images_to_video` | 参照画像 1-7 枚, 1 枚の場合も含む |

新しいリクエストでは `video_generation_mode` を明示してください. 省略すると従来の単一画像の扱いが維持され, `reference_images` が 1 枚だけの場合は参照モードになりません. テキストモードでは画像を送信できません.

## 認証

**Authorization** `string` *required*

API キーを Bearer Token として指定してください.

```text theme={null}
Authorization: Bearer YOUR_API_KEY
```

## リクエストパラメータ

**model** `string` *required* (default: grok-video-1.5)

公開モデル名 `grok-video-1.5` を使い, 供給元のモデル名に置き換えないでください.

**prompt** `string`

シーンと動きを指定します. テキストと参照画像のモードでは必須です. 従来の単一フレームリクエストの一部では省略できますが, それ以外では必要な場合があります. 新しい連携では空でないプロンプトを指定してください.

**video\_generation\_mode** `string`

従来のクライアントでは省略できます. 実際の入力に合う値を選びます: テキストのみは `text_to_video`, 開始フレームが 1 枚は `first_frame_image_to_video`, 参照画像が 1-7 枚は `reference_images_to_video`. モードは `image`, `input_reference` または `reference_images` の実際の入力と一致する必要があり, 一致しない場合は拒否されます. 参照画像が 1 枚の場合は, 従来の開始フレーム入力と区別するため参照モードを明示してください.

**image** `string`

開始フレームの URL. 開始フレームモードで必須ですが, 代わりに `input_reference` を使えます. テキストと参照画像のみのモードでは省略します. 開始フレームの上流での扱いはチャネルによって異なります.

**input\_reference** `string`

開始フレーム URL の文字列エイリアス. `image` とどちらか一方を使い, 異なる値を両方に設定しないでください. 新しいリクエストでこのフィールドを使う場合はモードも明示してください.

**reference\_images** `array`

参照画像 1-7 枚の URL. 文字列配列または `{"url":"https://example.com/reference.jpg"}` のオブジェクト配列を使えます. 参照モードで必須です. 従来の `image_urls` と `images` も利用できますが, 内容の異なる複数のリストを同時に送信しないでください.

**duration** `integer`

整数の秒数を明示してください. 1-15 秒に対応します.

**resolution** `string`

参照画像モードでは `480p` または `720p` を使います. テキストと開始フレームモードでは対応チャネルで `1080p` を使えます. このページの例では `720p` を明示しています.

**aspect\_ratio** `string`

動画の縦横比, 例: `16:9`. 一般的な値は `1:1`, `16:9`, `9:16`, `3:2`, `2:3` です. 対応範囲はチャネルによって異なります.

## 互換性の制限

一部のチャネルでは単一の開始フレームと単一の参照画像を同じ方法で処理します. モード名だけでは厳密な開始フレーム制御を保証しません. モードが有効でもプロトコルの制限は適用されます. 未対応の入力は送信前に拒否される場合があり, 対応する有効なチャネルがなければ生成できません.

## 料金

動画料金は現在のアカウントと SKU 設定に従います. [現在の料金](https://toapis.com/pricing)と認証済みのパラメータ別見積もりを確認してください. このページは固定の秒単価を保証しません.

## 動画タスクの作成

例ではモード, 長さ, 解像度を明示しています. 画像 URL を実際にアクセスできるものに置き換えてください.

```bash cURL theme={null}
curl --request POST \
  --url https://toapis.com/v1/videos/generations \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "grok-video-1.5",
  "prompt": "A cinematic product shot with a slow camera push-in",
  "video_generation_mode": "text_to_video",
  "duration": 8,
  "resolution": "720p",
  "aspect_ratio": "16:9"
}'
```

```python Python theme={null}
import requests

response = requests.post(
    "https://toapis.com/v1/videos/generations",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "model": "grok-video-1.5",
        "prompt": "A cinematic product shot with a slow camera push-in",
        "video_generation_mode": "first_frame_image_to_video",
        "image": "https://example.com/first-frame.jpg",
        "duration": 8,
        "resolution": "720p",
        "aspect_ratio": "16:9"
    },
)
response.raise_for_status()
print(response.json()["id"])
```

### 参照画像の例

```json theme={null}
{
  "model": "grok-video-1.5",
  "prompt": "A cinematic product shot with a slow camera push-in",
  "video_generation_mode": "reference_images_to_video",
  "reference_images": [
    "https://example.com/reference-a.jpg",
    "https://example.com/reference-b.jpg"
  ],
  "duration": 8,
  "resolution": "720p",
  "aspect_ratio": "16:9"
}
```

## レスポンス

**id** `string`

ポーリング用のタスク ID.

**object** `string`

オブジェクト種別: `generation.task`.

**model** `string`

リクエストの公開モデル名.

**status** `string`

状態: `queued`, `in_progress`, `completed`, `failed`.

```json 200 theme={null}
{
  "id": "video_abc123def456",
  "object": "generation.task",
  "model": "grok-video-1.5",
  "status": "queued",
  "progress": 0,
  "created_at": 1768380224,
  "metadata": {}
}
```

## タスクの状態確認

返された `id` を[動画タスク状態 API](https://docs.toapis.com/docs/ja/api-reference/tasks/video-status.md)に渡してください.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.