# video

Canonical URL: https://developers.iagenify.com/sdk/ref/tools/video/
Language: en

`tools: { video: api.tools.video }, model: { main, video }`

Lets a run generate a short video, starting from an image the run already made when there is one. A declaration resolved against a session named video.

Status: declaration only · needs a video session · declared cost 85

Nothing to call. The clip is produced by a [model session](/sdk/ref/models/create) handed to the run under the name `video`.

## Declaring it {#declaring}

```javascript
const writer = await api.models.create({ model: "gemini-3.5-flash" });
const filmer = await api.models.create({
  model: "veo-3.1",
  settings: { duration: 4, resolution: "720p", audio: true },
});

const agent = api.agents.create({
  model: { main: writer, video: filmer },
  tools: { video: api.tools.video },
  budget: 400,
});
```

## What the model sends {#arguments}

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `prompt` | string | required | What to create — the scene, in one argument. |

Duration, resolution and audio are the session's settings, not the model's choice: they determine the price, so they are decided where you can see them.

## It picks up the last image of the run {#starting-image}

> **No argument carries it, and none has to**
>
> If the run has produced an image, the most recent one is passed as the clip's first frame. So « draw the logo, then animate it » works with both tools declared and nothing else — and the model does not have to carry an image through its own context.

```javascript
tools: {
  image: api.tools.image,
  video: api.tools.video,         // starts from whatever image came before
}
```

## Where the clip goes {#result}

```javascript
const [clip] = run.artifacts.filter((a) => a.type === "video");
await pc.files.write("Assets/intro.mp4", Buffer.from(clip.content, "base64"));
```

## The declared cost is 85 {#cost}

Video is the most expensive thing a run can do, and the guard refuses on the declared number before the call. 85 is a deliberate over-estimate: a clip can come back longer than it was asked for, and a figure that merely matched the expected length would let a run pass its budget.

| Setting | Who decides | Why |
| --- | --- | --- |
| duration | the session | It is what the price is per. |
| resolution | the session | It changes the price. |
| audio | the session | Only some models have it. |
| prompt | the model | It is the only creative decision. |

## It takes minutes, not seconds {#time}

Generation is a long operation, polled to completion. A run with `video` declared needs a `maxSteps` and a patience to match — and the call carries no client-side timeout, because abandoning it would pay for a clip you never receive.

## Set a budget you mean {#budget}

```javascript
const agent = api.agents.create({
  model: { main: writer, video: filmer },
  tools: { video: { run: api.tools.video, cost: 120 } },
  budget: 400,                  // three clips at most, whatever the model intends
});
```

- [image](/sdk/ref/tools/image): The still, which can become the first frame.
- [create_video](/sdk/agent/tools/create-video): The local engine's version.
- [api.tools](/sdk/ref/tools): The fifteen, and the two ways to use them.

```python
writer = api.models.create(model="gemini-3.5-flash")
filmer = api.models.create(
    model="veo-3.1",
    settings={"duration": 4, "resolution": "720p", "audio": True},
)

agent = api.agents.create(
    model={"main": writer, "video": filmer},
    tools={"video": api.tools.video},
    budget=400,
)
```

```python
tools = {
    "image": api.tools.image,
    "video": api.tools.video,      # starts from whatever image came before
}
```

```python
import base64

clip = next(a for a in run["artifacts"] if a["type"] == "video")
pc.files.write("Assets/intro.mp4", base64.b64decode(clip["content"]))
```

```python
agent = api.agents.create(
    model={"main": writer, "video": filmer},
    tools={"video": {"run": api.tools.video, "cost": 120}},
    budget=400,                    # three clips at most, whatever the model intends
)
```
