Access top video generation models through a unified API -- text-to-video, motion control, and more.
Add Authorization header to all requests:
Authorization: Bearer YOUR_API_KEY
/api/v1/video/generationsCreate a video generation task
/api/v1/video/generations?task_id=xxxQuery task status and get video URL
/api/v1/video/p-videoSYNCP-Video dedicated sync endpoint: one request blocks ~30-60s and returns the video URL directly (no polling)
Select a provider to see its parameters and examples
High-quality text-to-video generation by xAI. Supports 5s/10s/15s video with natural motion.
grok-video-3grok-video-3-10sgrok-video-3-official# Step 1: Create task
curl -X POST https://apimodels.app/api/v1/video/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-video-3",
"prompt": "A cat playing piano in a jazz club, cinematic lighting",
"aspect_ratio": "16:9"
}'
# Step 2: Poll status
curl "https://apimodels.app/api/v1/video/generations?task_id=TASK_ID" \
-H "Authorization: Bearer YOUR_API_KEY"{
"code": 200,
"msg": "success",
"data": {
"taskId": "clxxx...",
"state": "pending"
}
}{
"code": 200,
"msg": "success",
"data": {
"taskId": "clxxx...",
"state": "completed",
"resultUrls": ["https://cdn.example.com/video.mp4"],
"createTime": 1705123450000,
"completeTime": 1705123500000
}
}{
"code": 200,
"msg": "success",
"data": {
"taskId": "clxxx...",
"state": "failed",
"failMsg": "Content policy violation"
}
}Pass callback_url in the create request. When the task reaches the completed or failed terminal state, our server sends a single HTTP POST to that URL with Content-Type: application/json (no signing header). Delivery is retried up to 3 times (exponential backoff 1s/2s/4s, 10s per attempt); if still unsuccessful, a background job keeps retrying for up to 30 minutes until your endpoint returns 2xx.
POST {your callback_url}
Content-Type: application/json
{
"code": 200,
"msg": "success",
"data": {
"taskId": "clxxx...",
"model": "<provider>/<model_name>",
"state": "completed" | "failed",
"param": "<JSON string>", // request params, JSON.parse once
"resultJson": "<JSON string> | null", // result object, JSON.parse once
"failCode": null | "string",
"failMsg": null | "string",
"costTime": 12345, // duration in ms
"completeTime": 1705123500000, // ms epoch
"createTime": 1705123450000 // ms epoch
}
}Note: data.param and data.resultJson are both JSON strings — call JSON.parse once on each.
{
"resultUrls": ["https://r2.apimodels.app/videos/xxx.mp4"],
"thumbnailUrl": "https://...jpg", // optional (kie / cloud-video only)
"videoSize": "1280x720", // optional (kie / cloud-video)
"videoDuration": 5, // optional, seconds
"videoModel": "veo3" // optional (kie / cloud-video)
}resultUrls is always present (length 1 in success, [] on failure). Other fields are optional and provider-dependent — read defensively. When state=failed, resultJson is typically null or {"resultUrls":[]}; do not assume a video URL is present.
app.post('/webhook/video', express.json(), (req, res) => {
const { taskId, state, resultJson, failMsg } = req.body.data
if (state === 'completed') {
const r = JSON.parse(resultJson)
console.log('video ready', taskId, r.resultUrls[0], r.videoDuration)
} else {
console.warn('video failed', taskId, failMsg)
}
res.status(200).end() // must be 2xx, otherwise we retry
})pendingQueued, waiting to startprocessingVideo is being generatedcompletedDone -- video URL availablefailedGeneration failed400Bad Request -- invalid or missing parameters401Unauthorized -- invalid API key402Payment Required -- insufficient credits404Not Found -- task ID not found500Internal Server Error