# media.generate

Canonical URL: https://developers.iagenify.com/sdk/workflows/steps/media-generate/
Language: en

`type: "media.generate"`

Generates an image, a video, a voice or a music clip. The settings are checked against the real price grid when you save.

Status: kind and prompt required · validated on save · the expensive step

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `kind` | string | required | `image` · `video` · `voice` · `music`. |
| `prompt` | string | required | What to create. For a voice, the exact words. |
| `model` | string |  | Which model. A sensible default per kind. |
| `settings` | object |  | Resolution, duration, audio, voice, tempo… |
| `image` | string |  | A starting picture. **Only for `video` and `image`.** |
| `storage · path` | string |  | Save it rather than returning it. |

## The settings are checked against the grid {#validated}

> **A setting a model cannot honour is refused on save**
>
> Audio on a model with no sound, or a resolution it does not produce, would otherwise fall back to the most expensive row of that model — generating one format while billing another. It is refused where you are still reading the message.

`image` on a voice or a music step is refused too: it would be accepted and then ignored, which is worse than failing — you would believe the picture counted.

```javascript
{ id: "cover", type: "media.generate", config: {
    kind: "image", prompt: "A quiet harbour at dawn, flat illustration",
    settings: { resolution: "2K" },
    storage: "…", path: "covers/{{input.week}}.png" } }
```

## Output {#output}

```javascript
{{steps.cover.output.kind}}
{{steps.cover.output.mime}}
{{steps.cover.output.path}}       // when it was saved
{{steps.cover.output.content}}    // when it was not
```

## It is the expensive step {#cost}

A video is priced per second and can run to hundreds of credits. On a scheduled trigger, that is paid every firing with nobody deciding each time.

- [create_video](/sdk/agent/tools/create-video): The same generation, for an agent.
- [file.save](/sdk/workflows/steps/file-save): Saving it elsewhere.
- [Workflow steps](/sdk/workflows/steps): The 23 types.

```python
{"id": "cover", "type": "media.generate", "config": {
    "kind": "image", "prompt": "A quiet harbour at dawn, flat illustration",
    "settings": {"resolution": "2K"},
    "storage": "…", "path": "covers/{{input.week}}.png"}}
```

```python
"{{steps.cover.output.kind}}"
"{{steps.cover.output.mime}}"
"{{steps.cover.output.path}}"       # when it was saved
"{{steps.cover.output.content}}"    # when it was not
```
