Generate Asset
generate_assetCreate a single image, video, or audio asset from a text prompt without rendering a full edit. Cached identical prompts are reused; explicit confirmation is required.
Instructions
Generate a single image, video or audio asset from a text prompt without rendering a full edit. Submit a prompt-bearing asset; the response is immediate when an identical asset has been generated before (results are cached by prompt, model and options), otherwise the job is queued and can be polled via the status endpoint.
Generation is billed in credits per asset. Identical repeat requests resolve from the cache at no charge.
Base URL: https://api.shotstack.io/edit/{version} Explicit confirmation is required for this exact action; provider charges, hosting, sharing or deletion may apply. Never automatically resubmit unknown outcomes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| asset | No | ||
| length | No | The length, in seconds, of the clip the asset fills. A model that generates to a duration takes it from this value in place of its own duration option. Other models ignore it. | |
| account | No | Named private Shotstack account; selects private credentials and stage/v1 environment. | |
| confirm | No | Must be true for this exact requested render, generation, mutation, upload URL or deletion. | |
| payload | No | Complete JSON request body instead of body flags. Preserves current endpoint fields and values. | |
| payload_file | No | Regular local JSON body file, at most 5 MB. Cannot be mixed with body flags or payload. | |
| idempotency_key | No | A key that makes this request its own generation. Retrying with the same key returns the job it first created instead of generating and billing again, and a new key generates afresh even when the asset matches an earlier one. Without a key, identical assets share one cached result. For 24 hours a key reused for a different asset is rejected; after that it returns its first result. |