API documentation

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.

Long-running request
Generation is synchronous: the HTTP connection stays open while the provider renders the video. Use a generous client timeout, for example 10-15 minutes.
Exact model id
Send the exact catalog or /v1/models id in the model field. If the model is hidden or unavailable for the key, the request returns an access or temporary availability error.

Endpoint

txt
POST https://api.aigate.shop/v1/video/generationsAuthorization: Bearer sk-your-api-keyContent-Type: application/json

POST /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

Request
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.

Kling example
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.

prompt.text + prompt.image
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  }'
string prompt + input_image
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.

Request with input_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": "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

Finished video
{  "created": 1780047578,  "model": "provider/video-model-id",  "duration": 5,  "videos": [    {      "url": "https://api.aigate.shop/v1/videos/task_qZj21ARTSQzsyHoh82QBs7oPwnKvCOIu/content",      "mime_type": "video/mp4"    }  ]}
Temporary content link
Read the file from videos[0].url. This is a public temporary AIGate link; it hides the provider URL and expires after 20 minutes. AIGate does not permanently store videos; it streams the file from the provider's temporary URL.

Save the file

ts
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

FieldRequiredMeaning
modelyesExact video model id from the catalog or /v1/models.
promptyesVideo description. Pass a string or an object with { text, image } for image-to-video.
input_image / image_url / image / input_image_urlnoSource image: URL, data URL, or another value supported by the selected model.
input_image_b64noBase64 image input without a separate URL.
input_videonoSource video for models that can edit or continue a clip.
input_video_b64noBase64 video input without a separate URL.
durationnoClip length in seconds. Limits depend on the model.
resolutionnoFor example 480p, 720p, 1080p, 4K, or WIDTHxHEIGHT. Support depends on the model.
aspect_rationo16:9, 9:16, 1:1, 4:3, 3:4
nnoNumber of videos. Defaults to one when omitted.
audionoEnable or disable audio when the model supports it.
qualitynoGeneration quality, for example draft, std, or pro when supported by the model.
negative_promptnoContent to avoid in the video.
seednoSeed for repeatable generation when supported.
usernoYour client-side user identifier. Use it only if your app tracks one.
provider_options / metadatanoProvider-specific options. metadata is accepted as a compatibility alias.

Errors

StatuscodeCauseFix
401http_401The key is missing or invalid.Check Authorization: Bearer sk-...
404not_foundWrong path, task id, or model id.Check endpoint, model id, and URL.
410http_410The content link has expired.Generate again or download within 20 minutes.
429insufficient_quotaNot enough balance or quota for the request.Add balance or reduce generation parameters.
500/502/503api_errorThe provider could not process the video temporarily.Retry later, reduce parameters, or choose another available model.
Expired link
{  "error": {    "message": "Video link expired",    "type": "invalid_request_error",    "code": "http_410",    "status": 410  }}