remagicaDocs home
API referenceGenerations

Generate a video

POST
/generations/videos

Needs a key withgenerations:submit

Starts generating a video from a prompt, a first (and last) frame, or reference images, videos and audio. Pick the model from GET /models; the request is validated against what that model accepts, and files are referenced by storage key (an upload's key or an earlier generation's output key).

Mention Library items in the prompt with their mention token ([@ id="lib:<itemId>" label="ninja"], or lib:<itemId>@v2 for a version): their files are added after your references, the prompt points at them, and their locked descriptions are added. Point at references yourself as @Image1, @Video1, @Audio1 (the n-th of that kind); each provider gets its own syntax.

The response is 202 Accepted with the generation. Poll GET /generations/{generationId} until status is completed (then outputs holds the files) or failed.

Requires scope generations:submit.

Authorization

apiKey
headerx-api-key<token>

An API key of your workspace (rmg_…), created in the web app. It acts for that workspace, not for a person, and keeps working when its creator leaves.

Header Parameters

Idempotency-Key?string

Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is 409 CONFLICT. A request that fails frees its key.

Length1 <= length <= 255

Request Body

application/json
  1. body

A video request.

aspectRatio?string

Output aspect ratio. auto lets the model decide; some models always keep the first frame's.

Value in"auto""21:9""16:9""4:3""1:1""3:4""9:16"
cfgScale?number

How closely to follow the prompt (0-1). Only models with capabilities.cfgScale take it (Kling).

Range0 <= value <= 1
draft?boolean

Make a cheap 480p draft to preview the shot, billed as a normal 480p video. Render the final from it with fromDraft. Only models with capabilities.draft take it (Seedance 2.5).

duration?|

Length in seconds, or auto to let the model choose.

firstFrame?|
fromDraft?

Render the final video of a draft (at capabilities.draft.finalResolution): the draft's prompt, files, length, ratio and sound are reused as they were, and the final is billed in full on its own. Drafts can be rendered for 7 days.

generateAudio?boolean

Generate sound (voices, effects, music) with the video. Off gives a silent video.

Defaulttrue
lastFrame?|
mode?string

text: prompt only. first_frame: animate firstFrame. first_last_frame: go from firstFrame to lastFrame. reference: use referenceImages, referenceVideos and referenceAudios as references.

Default"text"
Value in"text""first_frame""first_last_frame""reference"
negativePrompt?string

What to keep out of the video. Only models with capabilities.negativePrompt take it (Kling, Veo).

Lengthlength <= 2000
prompt*string
Length1 <= length <= 20000
promptExpansionMode?string

How much the model rewrites the prompt first: disabled, balanced (about a second) or quality (up to ~30 s). Only models whose params list it (H3 Max).

Value in"disabled""balanced""quality"
referenceAudios?array<|>
Itemsitems <= 30
Default[]
referenceImages?array<|>
Itemsitems <= 30
Default[]
referenceRoles?array<>

A name and role for reference files, by kind and number. Models whose capabilities.referenceRoles is set (Seedance) get them as a 【Reference Asset Roles】 block at the top of the prompt, unless the prompt has one of its own.

Itemsitems <= 90
referenceVideos?array<|>
Itemsitems <= 30
Default[]
resolution?string
Value in"480p""720p""768p""1080p""4k"
seed?integer
Range0 <= value <= 2147483647
shots?array<>

Multi-shot: the video as shots, each with its prompt and length (adding up to duration). Only models with capabilities.multiShot take it; prompt then describes the whole.

Items2 <= items <= 6
shotType?string

intelligent: the model plans its own shots. Only models whose params list it (Kling).

Value in"customize""intelligent"
from?

The generation this request carries on from (its file was sent here as a reference, frame or source), kept as metadata.from so the result can show what it was made from.

idempotencyKey?string

Makes the request safe to retry: a second request with the same key in this workspace returns the generation the first one started, and starts nothing (nor charges again). That holds when the first one failed too, even if it couldn't be queued (status: failed, failure.providerCode: not_queued, its credits refunded): to try again, send a new key.

Length1 <= length <= 200
model*string

Video model id from GET /models.

Length1 <= length <= 200
source?string

Where the request comes from, kept on the generation as metadata.source (e.g. tool:image), so you can tell your own surfaces apart.

Match^[a-z0-9][a-z0-9:_-]{0,63}$
visibility?string

private (the default): your workspace only. public: also in Community, for every Remagica user, once it completes. Needs a signed-in person (not an API key).

Value in"private""public"

Response Body

Accepted: the generation is queued.

application/json
  1. response

One generation request and its results.

completedAt*|null
createdAt*string
Formatdate-time
createdByUserId*|

Who asked for it; null when an API key did (keys belong to the workspace).

credits*integer

Credits this request costs.

creditsRefunded*boolean

Its credits came back: it failed or was cancelled before its provider billed anything. False while it runs, once it completed, and when a failed one kept them because its provider billed (or may still bill) what it was sent (error says so).

error*|

Why it failed, when status is failed.

id*string
input*

The request as accepted, defaults filled in and @ mentions resolved (their files added to the references, the prompt pointing at them as @Image1, @Video1, ...).

kind*string

What the model makes: image, video, speech, sound_effect, music or background_removal (a cutout of an image).

Value in"image""video""speech""sound_effect""music""background_removal"
metadata*

Extras from the model, e.g. seed, or timestamps (word timings) for speech, and the request's source when it named one.

model*string
organizationId*string

Id of the workspace that owns it (yours).

outputs*array<>
publishedAt?|

When it was made public; null while it's private.

references*array<>

The Library items the prompt mentioned, pinned to the version and files used.

status*string

queued → running → completed, or failed / cancelled.

Value in"queued""running""completed""failed""cancelled"
stopRequested*boolean

It was cancelled while its provider was already rendering it: nothing more is sent for it, and it finishes and is charged (or, should the provider stop it after all, ends cancelled).

updatedAt*string
Formatdate-time
visibility?string

private: your workspace only. public: also in Community, for every Remagica user. Always set in responses (optional only for older clients).

Value in"private""public"
Example Request
curl -X POST 'https://api.remagica.com/api/v1/generations/videos' \  -H 'Content-Type: application/json' \  -d '{  "prompt": "A lighthouse on a cliff at dusk, cinematic",  "model": "bytedance/seedance-2.0"}'
Example Response
{  "completedAt": "2026-10-21T12:00:00.000Z",  "createdAt": "2026-09-30T12:00:00.000Z",  "createdByUserId": "f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05",  "credits": 12,  "creditsRefunded": true,  "error": null,  "id": "7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05",  "input": {    "prompt": "A lighthouse on a cliff at dusk, cinematic"  },  "kind": "image",  "metadata": {    "seed": 42  },  "model": "google/nano-banana-pro",  "organizationId": "9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05",  "outputs": [    {      "contentType": "image/png",      "durationSeconds": 5,      "exportOf": {        "format": "string",        "index": 1      },      "height": 1280,      "key": "generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png",      "kind": "image",      "previews": [        {          "height": 1280,          "url": "https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png",          "width": 1024        }      ],      "previewUrl": "https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png",      "role": "output",      "sizeBytes": 2457600,      "url": "https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png",      "width": 1024    }  ],  "publishedAt": "2026-10-21T12:00:00.000Z",  "references": [    {      "fileIds": [        "string"      ],      "itemId": "59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05",      "label": "string",      "version": 3,      "versionId": "772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"    }  ],  "status": "queued",  "stopRequested": true,  "updatedAt": "2026-10-21T12:00:00.000Z",  "visibility": "private"}