MorphogenDocs
API

Create video

POST /v1/videos: create a video generation job.

POST/v1/videos

Creates a video generation job and immediately returns it with the queued status. Generation is asynchronous and usually takes up to a couple of minutes: check the status with Get video, then download the file with Video content. The request shape is compatible with the OpenAI Videos API, so the client.videos.* methods of the OpenAI SDK work.

Headers

HeaderValue
AuthorizationBearer <key>. Required. x-api-key: <key> is accepted instead
Content-Typeapplication/json or multipart/form-data (the OpenAI SDK sends this)
X-Morphogen-Spacespc_…: the spending space. Optional

Request body

modelstringrequired

A video model from GET /v1/models: for example grok-imagine-video, wan-3.0, seedance-2.0-mini or kling-3.0.

promptstringrequired

The clip description.

secondsstring | integer

The duration in seconds. Allowed values depend on the model. duration is accepted instead of seconds.

sizestring

The frame size, for example 854x480. You can pass resolution and aspect_ratio instead.

resolutionstring

The resolution, for example 480p, 720p or 1080p, if the model supports it.

aspect_ratiostring

The aspect ratio, for example 16:9.

generate_audioboolean

Generate sound. If omitted, sound is on for models that support it, and the price is then higher.

seedinteger

A seed for reproducibility, if the model accepts one.

frame_imagesarray

Reference frames for models that accept them as input.

input_referencesarray

Links to source images. Passing a file in input_reference is not supported.

Before the start, an amount is reserved on the account: the seconds multiplied by the price per second for the chosen resolution. If generation ends with an error or you cancel a job in the queue, no money is charged. Only a finished job is charged.

Request example

curl https://api.morphogen.ru/v1/videos \
  -H "Authorization: Bearer $MORPHOGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-video",
    "prompt": "бумажный кораблик на озере на закате",
    "seconds": "4",
    "size": "854x480"
  }'

Response example

{
  "id": "video_7f3a91c2",
  "object": "video",
  "model": "grok-imagine-video",
  "status": "queued",
  "seconds": "4",
  "size": "854x480",
  "created_at": 1760104212
}

Save the id: you use it to check the status and download the file.

Errors

400unsupported_video_parameterThe duration, resolution or aspect ratio is not in the model's list, or a file is passed in input_reference.
400missing_modelThe body has no model.
400missing_promptThe body has no prompt.
400invalid_secondsThe duration could not be parsed.
400invalid_jsonThe request body could not be parsed.
400model_category_mismatchThe model is not in the video category.
401invalid_api_keyThe key is not found, disabled or expired.
402insufficient_fundsThe balance does not cover the reserve.
402key_limit_exceededThe daily or monthly key limit is used up.
429rate_limit_exceededThe request limit per minute is exceeded.

Other codes: Errors. Guide: Images and video.

On this page