• Docs
  • API reference
  • SDKs & tools
  • Models
  • Changelog
Sign inGet an API key
DocsAPI referenceSDKs & toolsModelsChangelog

Start here

IntroductionGetting startedAuthenticationPricing and billingBeta

Concepts

TasksPrompts and imagesDestinationsWebhooksRate limits

Models

The model fieldChoosing an image modelVideo models

Guides

Generate imagesGenerate videoImage to imageEnhance prompts
  1. Docs
  2. /
  3. Guides
  4. /
  5. Generate

Generate video

Start a video render on an explicit model, with optional frame inputs, and collect the file.

PreviousGenerate imagesNextImage to image

On this page

FieldsSizesFrame inputsWhat comes backPriceNext steps

POST /video/generate creates a video task. model and prompt are required. One request renders one video, and there is no auto or count.

import Mynth from "@mynthio/sdk";

const mynth = new Mynth();

const task = await mynth.video.generate({
  model: "bytedance/seedance-2.0-mini",
  prompt: "A lighthouse beam sweeping over waves",
  duration: 5,
  size: "9:16_720p",
});

console.log(task.urls[0]);

The REST call returns a task_id and estimated_cost at once. The SDK waits up to an hour. A render takes minutes, so in a request handler, create the task with generateAsync() and finish in a webhook instead of waiting. The CLI has no video command.

Fields

FieldNotes
modelRequired. An id from video models
promptRequired. 1 to 8192 characters
negative_promptOptional. Up to 8192 characters
sizeAspect ratio and resolution tier. Defaults to auto. See sizes
durationSeconds. Defaults to the model's default. Each model accepts its own range
audioGenerated audio. Defaults to the model's default, which is on for every current model
inputsFrame images. See frame inputs
webhookPer-request URLs, same shape as on images. See webhooks
metadataA JSON object up to 2048 bytes
generate_public_access_tokentrue returns a browser token as public_access_token. See from a browser

Video does not take destination, count, magic_prompt, or output. Sending any of them answers 400 validation_error.

Every value is checked against the model when the task is created. A resolution tier, duration, audio setting, or input the model does not serve answers 400 validation_error, and nothing is queued.

Sizes

You ask for a shape and a resolution tier, not pixels. The shapes are the same as for images, and Mynth picks the closest aspect ratio the model serves. The tier is not adjusted: it sets the price, so a tier the model does not serve answers 400 validation_error.

sizeResult
auto, or no sizethe model's default shape and tier
square, portrait, landscape, portrait_tall, landscape_wide1:1, 2:3, 3:2, 9:16, 16:9
1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 2:1, 1:2that ratio
Any of the above with _480p, _720p, _1080p, or _4k, such as 9:16_1080pthat shape at that tier
{ "type": "aspect_ratio", "aspect_ratio": "9:16", "resolution": "1080p" }the same, as an object. resolution is optional
{ "type": "auto", "resolution": "1080p" }the model's default shape at that tier

With a first frame, the frame sets the shape and the aspect ratio is ignored. The tier still applies. The result's aspect_ratio is the ratio the video was rendered at, or null when the frame set it.

Frame inputs

Send inputs to animate from an image. Each input is a URL string or an object with a role:

{
  "model": "bytedance/seedance-2.0-mini",
  "prompt": "The camera pulls back from the lighthouse",
  "inputs": [
    {
      "type": "image",
      "as": "first_frame",
      "source": { "type": "url", "url": "https://cdn.example.com/start.png" }
    },
    {
      "type": "image",
      "as": "last_frame",
      "source": { "type": "url", "url": "https://cdn.example.com/end.png" }
    }
  ]
}

Every current model needs exactly one first_frame for image-to-video. Seedance and Gemini Omni Flash also take an optional last_frame. P-Video and Grok Imagine Video take the first frame only. Video models has the table, and modes on the catalog entry is the live contract.

What comes back

{
  "model": "bytedance/seedance-2.0-mini",
  "videos": [
    {
      "status": "success",
      "id": "vid_3HkP9wQz7LmR2tXc8VbN5dFy0JsA4gUe",
      "url": "https://cdn.mynth.io/videos/vid_3HkP9wQz7LmR2tXc8VbN5dFy0JsA4gUe.mp4",
      "mynth_url": "https://cdn.mynth.io/videos/vid_3HkP9wQz7LmR2tXc8VbN5dFy0JsA4gUe.mp4",
      "cost": "0.40500000",
      "duration": 5,
      "resolution": "720p",
      "aspect_ratio": "9:16",
      "audio": true
    }
  ]
}

Check status on the video. A refusal or a provider failure fails the item with an error.code while the task still completes. The file is served for 7 days. See tasks.

Price

Video is per_second[tier] × duration, where tier is the resolution in size, and the estimate is exact because the model is explicit. Price a body with POST /video/generate/estimate, or mynth.video.estimate() in the SDK. Pricing has the formula.

Next steps

  • Video models: resolutions, durations, and frame inputs per model.
  • Webhooks: collect a long render without holding a connection.
  • Poll for results: the status and result calls.