Video Generation API
A unified REST API to generate videos from text prompts or images using 7+ AI models. Video generation is asynchronous — submitting a request returns a task ID, and you poll a separate status endpoint until the video is ready.
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /generate/text-video | Submit a text-to-video task. Returns a taskId immediately. |
POST | /generate/image-video | Submit an image-to-video task. Returns a taskId immediately. |
GET | /generate/video-status | Poll task status. Query params: taskId, outputType (url|binary). |
:::tip Asynchronous
Submitting a task returns a taskId. Retrieve the finished video with the Check Video Status API.
:::
Parameters
Request body fields for /generate/text-video:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | — | Model ID to use for generation, e.g. KLING-3.0-TURBO, SEEDANCE-2.0-MINI, WAN-2.7-VIDEO, HAILUO-2.3, GROK-IMAGINE-VIDEO-1.5, GEMINI-OMNI, HAPPYHORSE-1.1. |
prompt | string | Yes | — | Text description of the video (or, for image-video, how the image should be animated). |
duration | number | Yes | — | Length of the video in seconds. Valid values depend on the selected model (e.g. 4–15s, or fixed 6/10s for some models). |
resolution | string | Yes | — | Output resolution. One of "480p", "720p", or "1080p" depending on model support — pricing varies per resolution. |
aspect_ratio | string | No | "16:9" | Output aspect ratio. One of "16:9", "9:16", or "1:1". |
image | string[] | No | — | Array containing the source image URL. Required only for image-to-video generation (/generate/image-video). |
Video rendering can take anywhere from several seconds to a few minutes depending on duration, resolution, and model. Poll on an interval (e.g. every 3-5s) rather than in a tight loop.
Response example
create
{
"success": true,
"taskId": "imagegpt-vid-...",
"status": "waiting",
"creditsDeducted": 125
}
status · url
Returns JSON. status is "waiting" while rendering, then "success" with a hosted video url once done.
{
"success": true,
"status": "success",
"url": "https://...mp4"
}
status · binary
Returns the raw video file directly once it's ready (no JSON wrapper).
const blob = await response.blob();
const url = URL.createObjectURL(blob);
Examples
fetch('https://api.imagegpt.online/generate/text-video', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
model: 'KLING-3.0-TURBO',
prompt: 'A serene sunset over the ocean with gentle waves',
duration: 6,
resolution: '720p',
aspect_ratio: '16:9'
})
})
.then(res => res.json())
.then(data => console.log('Task ID:', data.taskId));
body: JSON.stringify({
model: 'WAN-2.7-VIDEO',
prompt: 'Animate the scene with gentle camera movement',
image: ['https://example.com/input.jpg'],
duration: 5,
resolution: '1080p',
aspect_ratio: '9:16'
})
fetch('https://api.imagegpt.online/generate/video-status?taskId=imagegpt-vid-...&outputType=url', {
headers: { 'x-api-key': 'YOUR_API_KEY' }
})
.then(res => res.json())
.then(data => console.log('Status:', data.status, data.url));
Pricing
Charged in credits per second of footage. The per-second rate depends on both the model and the chosen resolution. Total cost = credits/second × duration.
Models
Each model has its own page with parameters, examples, and a live playground.
| Model | Model ID | Durations (s) | Resolutions | Credits/s |
|---|---|---|---|---|
| Kling 3.0 Turbo | KLING-3.0-TURBO | 4–15 | 720p, 1080p | 720p: 100 · 1080p: 125 |
| Seedance 2.0 Mini | SEEDANCE-2.0-MINI | 4–15 | 480p, 720p | 480p: 50 · 720p: 120 |
| Wan 2.7 | WAN-2.7-VIDEO | 4–15 | 720p, 1080p | 720p: 100 · 1080p: 125 |
| Hailuo 2.3 | HAILUO-2.3 | 6, 10 | 720p, 1080p | 720p: 30 · 1080p: 40 |
| Grok Imagine | GROK-IMAGINE-VIDEO-1.5 | 4–15 | 480p, 720p | 480p: 15 · 720p: 25 |
| Gemini Omni | GEMINI-OMNI | 6, 10 | 720p, 1080p | 720p: 200 · 1080p: 250 |
| Happy Horse | HAPPYHORSE-1.1 | 4–15 | 720p, 1080p | 720p: 125 · 1080p: 160 |
| Seedance 2.5 | SEEDANCE-2-5 | 4–30 | 480p, 720p | 480p: 150 · 720p: 350 |