---
title: "Start media generation"
method: POST
path: "/v1/media/generations"
tags: ["Media"]
---

# Start media generation

`POST /v1/media/generations`

## Request

- Base URL: `https://api.dexto.ai`
- URL: `https://api.dexto.ai/v1/media/generations`
- Auth: HTTP bearer

Starts durable media generation from an unexpired estimate. Reuse the same Idempotency-Key to safely recover a lost response. An account can have at most 5 generations in progress; further starts return 429 (retryable) until one finishes. Provider failures return 502 and are not retried with the same estimate.

## Headers

- `Idempotency-Key` string, required

## Request body

- object
  - `estimate_id` string, uuid, required
  - `overwrite` boolean: With save_to: replace a project file that already has an output's path.
  - `save_to` string: Keep the outputs as files of the key's Cloud project: a file path, or a prefix ending in / to save every output under it. Saved files are stored and charged like uploads. A deployed project's key keeps them under artifacts/ when this is omitted.

## Response `200`

Successful response.

- object
  - `completed` boolean, required
  - `completed_at` string, date-time, nullable, required
  - `created_at` string, date-time, required
  - `error` object, nullable, required
    - `category` string, nullable, required
    - `message` string, required
  - `id` string, uuid, required
  - `media_kind` 'audio' | 'file' | 'image' | 'video', required
  - `model` string, required
  - `object` 'media.generation', required
  - `resources` object[], required
    - `expired` boolean, required: The output was deleted at expires_at; it has no url or stored details.
    - `expires_at` string, date-time, nullable, required: When the output is deleted: 24 hours after a Cloud generation completes. Null when it is kept.
    - `file_id` string, uuid, nullable, required: The project file this output was saved as, when the generation asked to keep its outputs with save_to; null otherwise or until it is saved.
    - `file_path` string, nullable, required: The exact project file path this output was saved at with save_to; null otherwise, until it is saved, or once that file is deleted.
    - `filename` string, nullable, required
    - `id` string, required
    - `kind` 'audio' | 'binary' | 'image' | 'video', required
    - `mime_type` string, nullable, required
    - `uri` string, required
    - `url` string, uri, nullable, required: A signed link that downloads the output without an API key, minted on each read. Null once expired or when it cannot be served.
    - `url_expires_at` string, date-time, nullable, required: When url stops working: at most an hour after the read, never past expires_at.
  - `save` object, nullable, required: Where the outputs are being kept as project files; null without save_to.
    - `error_code` string, nullable, required: Why a failed save stopped, such as conflict for a taken path.
    - `overwrite` boolean, required
    - `status` 'pending' | 'saved' | 'failed', required
    - `to` string, required
  - `status` 'failed' | 'output_ready' | 'reserved' | 'running' | 'settled' | 'settlement_pending' | 'submitted' | 'submitting' | 'submission_uncertain', required
  - `updated_at` string, date-time, required

## Other responses

- `202`: Accepted.
- `400`: Invalid JSON or request fields.
- `401`: Missing or invalid API key.
- `402`: The account has insufficient credits.
- `403`: The account cannot perform this operation.
- `404`: The requested resource was not found.
- `409`: The request conflicts with existing resource state.
- `429`: The account exceeded this operation's request rate.
- `500`: Unexpected Dexto failure.
- `502`: The upstream model provider failed.
- `503`: A required Dexto service is temporarily unavailable.

---

[API](https://skmtc.dev/dexto/apis/dexto-api.md) - [All operations](https://skmtc.dev/dexto/apis/dexto-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dexto/apis/dexto-api/revisions/47eb880cffa5?raw)
