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

# 5. Video Generation

> Generate videos from prompts and optional media references with Seedance 2.

Video Generation creates new video clips from text prompts. Use it when you want AI-generated footage rather than an edit of existing footage.

## How It Works

Describe the shot, subject, style, camera motion, and desired duration. Mosaic sends the prompt and any selected image, video, or audio references to the generation model, then returns a video asset that can feed downstream tiles.

Use Video Generation for:

* Product shots and cinematic b-roll
* Social clips from a creative prompt
* Reference-guided motion from uploaded images or clips
* Sound-enabled generated scenes

## API Usage

Create an agent shell:

```bash theme={null}
curl -X POST "https://api.mosaic.so/agent/create" \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Seedance product shot",
    "visibility": "private"
  }'
```

Add a Video Generation node:

```bash theme={null}
curl -X POST "https://api.mosaic.so/agent/AGENT_ID/update" \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "operations": [
      {
        "op": "create_node",
        "node_type_id": "a2eb3ec2-da7a-4f97-94d2-a9a537548522",
        "params_used": {
          "prompt": "A cinematic handheld shot of a matte black water bottle on a mountain trail at sunrise",
          "model": "seedance-2",
          "resolution": "1080p",
          "duration": "8",
          "aspect_ratio": "9:16",
          "generate_audio": true
        }
      }
    ]
  }'
```

Then run the agent with no video inputs:

```bash theme={null}
curl -X POST "https://api.mosaic.so/agent/AGENT_ID/run" \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "callback_url": "https://your-webhook.com/mosaic"
  }'
```

## API Info

<AccordionGroup>
  <Accordion title="Node Params & API Details" icon="code">
    * **Node ID:** `a2eb3ec2-da7a-4f97-94d2-a9a537548522`

    ### Node params

    | Param              | Type                                                              | Required | Default        | Notes                                                            |
    | ------------------ | ----------------------------------------------------------------- | -------- | -------------- | ---------------------------------------------------------------- |
    | `prompt`           | `string`                                                          | Yes      | `""`           | Generation prompt.                                               |
    | `model`            | `"seedance-2"`                                                    | No       | `"seedance-2"` | Video model.                                                     |
    | `resolution`       | `"1080p" \| "4k"`                                                 | No       | `"1080p"`      | Requested output resolution. 4K is billed at 2x normal Seedance. |
    | `duration`         | `"auto" \| "4" ... "15"`                                          | No       | `"auto"`       | Duration in seconds, or automatic model choice.                  |
    | `aspect_ratio`     | `"auto" \| "21:9" \| "16:9" \| "4:3" \| "1:1" \| "3:4" \| "9:16"` | No       | `"auto"`       | Output aspect ratio.                                             |
    | `generate_audio`   | `boolean`                                                         | No       | `true`         | Generate synchronized audio when supported.                      |
    | `selected_context` | `{images:string[],videos:string[],audio:string[]}`                | No       | empty lists    | Uploaded references to guide generation.                         |

    ### Example

    ```json theme={null}
    {
      "prompt": "A cinematic macro shot of coffee pouring into a glass mug",
      "model": "seedance-2",
      "resolution": "1080p",
      "duration": "8",
      "aspect_ratio": "16:9",
      "generate_audio": true
    }
    ```

    For 4K output, use:

    ```json theme={null}
    {
      "prompt": "A cinematic macro shot of coffee pouring into a glass mug",
      "model": "seedance-2",
      "resolution": "4k",
      "duration": "8",
      "aspect_ratio": "16:9",
      "generate_audio": true
    }
    ```

    4K Seedance generations are billed at 2x normal Seedance.
  </Accordion>
</AccordionGroup>
