Video Generation
Generate short videos with supported video models.
The video route accepts any available video model from the catalog. The request shape is shared: text, source image, source video, and provider-specific options go through the same path. Supported duration, resolution, audio, and quality values depend on the selected model.
Endpoint
POST https://api.aigate.shop/v1/video/generationsAuthorization: Bearer sk-your-api-keyContent-Type: application/jsonPOST /v1/videos is also accepted for compatible clients. For new integrations, use /v1/video/generations: after generation completes, the response includes a videos array with the finished file URL.
Text to video
curl --max-time 900 https://api.aigate.shop/v1/video/generations \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "provider/video-model-id", "prompt": "A cinematic shot of a glass sphere floating over a neon city", "duration": 5, "resolution": "720p", "aspect_ratio": "16:9", "audio": false, "n": 1 }'Kling
For Kling models, use the same /v1/video/generations route. Shared parameters stay at the top level, and provider-specific values go into provider_options.
curl --max-time 900 https://api.aigate.shop/v1/video/generations \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "klingai/kling-v3.0-t2v", "prompt": "A realistic cinematic product shot, slow dolly camera movement, natural light", "duration": 5, "resolution": "720p", "aspect_ratio": "16:9", "audio": false, "quality": "std", "negative_prompt": "text, watermark, blurry, distorted hands", "seed": 42, "n": 1, "provider_options": { "cfg_scale": 0.65 } }'Image to video
You can pass a source image in two ways. A convenient form is a prompt object with text and image. If your client needs prompt to stay a string, use input_image, input_image_url, image_url, image, or input_image_b64.
curl --max-time 900 https://api.aigate.shop/v1/video/generations \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "provider/video-model-id", "prompt": { "text": "Animate this frame: slow camera push-in, soft light, smooth motion", "image": "https://picsum.photos/seed/aigate-video-frame/1024/768" }, "duration": 5, "resolution": "720p", "aspect_ratio": "16:9", "audio": false, "n": 1 }'curl --max-time 900 https://api.aigate.shop/v1/video/generations \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "provider/video-model-id", "prompt": "Turn the reference image into a short looping product shot", "input_image": "https://picsum.photos/seed/aigate-video-product/1024/1024", "duration": 5, "resolution": "720p", "aspect_ratio": "1:1", "audio": false }'Video input
For models that can edit or continue an existing video, pass the source clip through input_video. If the selected model does not support video input, the provider returns a parameter error.
curl --max-time 900 https://api.aigate.shop/v1/video/generations \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "provider/video-model-id", "prompt": "Make the camera movement smoother and keep the same subject", "input_video": "https://example.com/source.mp4", "duration": 5, "resolution": "720p", "aspect_ratio": "16:9", "provider_options": { "style": "cinematic" } }'Response
{ "created": 1780047578, "model": "provider/video-model-id", "duration": 5, "videos": [ { "url": "https://api.aigate.shop/v1/videos/task_qZj21ARTSQzsyHoh82QBs7oPwnKvCOIu/content", "mime_type": "video/mp4" } ]}Save the file
import { writeFile } from "node:fs/promises";const videoUrl = response.videos[0].url;const file = await fetch(videoUrl);if (!file.ok) { throw new Error(await file.text());}writeFile("aigate-video.mp4", Buffer.from(await file.arrayBuffer()));Request fields
| Field | Required | Meaning |
|---|---|---|
| model | yes | Exact video model id from the catalog or /v1/models. |
| prompt | yes | Video description. Pass a string or an object with { text, image } for image-to-video. |
| input_image / image_url / image / input_image_url | no | Source image: URL, data URL, or another value supported by the selected model. |
| input_image_b64 | no | Base64 image input without a separate URL. |
| input_video | no | Source video for models that can edit or continue a clip. |
| input_video_b64 | no | Base64 video input without a separate URL. |
| duration | no | Clip length in seconds. Limits depend on the model. |
| resolution | no | For example 480p, 720p, 1080p, 4K, or WIDTHxHEIGHT. Support depends on the model. |
| aspect_ratio | no | 16:9, 9:16, 1:1, 4:3, 3:4 |
| n | no | Number of videos. Defaults to one when omitted. |
| audio | no | Enable or disable audio when the model supports it. |
| quality | no | Generation quality, for example draft, std, or pro when supported by the model. |
| negative_prompt | no | Content to avoid in the video. |
| seed | no | Seed for repeatable generation when supported. |
| user | no | Your client-side user identifier. Use it only if your app tracks one. |
| provider_options / metadata | no | Provider-specific options. metadata is accepted as a compatibility alias. |
Errors
| Status | code | Cause | Fix |
|---|---|---|---|
| 401 | http_401 | The key is missing or invalid. | Check Authorization: Bearer sk-... |
| 404 | not_found | Wrong path, task id, or model id. | Check endpoint, model id, and URL. |
| 410 | http_410 | The content link has expired. | Generate again or download within 20 minutes. |
| 429 | insufficient_quota | Not enough balance or quota for the request. | Add balance or reduce generation parameters. |
| 500/502/503 | api_error | The provider could not process the video temporarily. | Retry later, reduce parameters, or choose another available model. |
{ "error": { "message": "Video link expired", "type": "invalid_request_error", "code": "http_410", "status": 410 }}