Create video
POST /v1/videos: create a video generation job.
/v1/videosCreates 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
| Header | Value |
|---|---|
Authorization | Bearer <key>. Required. x-api-key: <key> is accepted instead |
Content-Type | application/json or multipart/form-data (the OpenAI SDK sends this) |
X-Morphogen-Space | spc_…: the spending space. Optional |
Request body
modelstringrequiredA video model from GET /v1/models: for example grok-imagine-video, wan-3.0, seedance-2.0-mini or kling-3.0.
promptstringrequiredThe clip description.
secondsstring | integerThe duration in seconds. Allowed values depend on the model. duration is accepted instead of seconds.
sizestringThe frame size, for example 854x480. You can pass resolution and aspect_ratio instead.
resolutionstringThe resolution, for example 480p, 720p or 1080p, if the model supports it.
aspect_ratiostringThe aspect ratio, for example 16:9.
generate_audiobooleanGenerate sound. If omitted, sound is on for models that support it, and the price is then higher.
seedintegerA seed for reproducibility, if the model accepts one.
frame_imagesarrayReference frames for models that accept them as input.
input_referencesarrayLinks 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
unsupported_video_parameterThe duration, resolution or aspect ratio is not in the model's list, or a file is passed in input_reference.missing_modelThe body has no model.missing_promptThe body has no prompt.invalid_secondsThe duration could not be parsed.invalid_jsonThe request body could not be parsed.model_category_mismatchThe model is not in the video category.invalid_api_keyThe key is not found, disabled or expired.insufficient_fundsThe balance does not cover the reserve.key_limit_exceededThe daily or monthly key limit is used up.rate_limit_exceededThe request limit per minute is exceeded.Other codes: Errors. Guide: Images and video.