POST/v1/videos
Render an MP4, WebM or GIF from a template whose layers animate, or from HTML with CSS animations
Give layers an animate (an entrance such as slide-up, fade, pop, wipe-right or type, a loop such as float or pulse, an exit) and the template becomes a video; or send html whose CSS animations should play. Every frame is the real page at that moment, so fonts, text that fits itself, charts and QR codes look exactly as they do in images. Up to 30 s and 1080p; GIFs up to 1200 px. The answer is 202 with the final url assigned (it answers 404 until the file is ready); poll GET /v1/videos/{id}, pass webhook_url, or set wait to true to get the finished video in the response. Costs one image per second of video, reserved before rendering.
REQUEST BODY · APPLICATION/JSON · REQUIRED
{
"template": {
"width": 1200,
"height": 630,
"background": "#0b1220",
"layers": [
{
"name": "title",
"type": "text",
"x": 72,
"y": 200,
"width": 1056,
"height": 200,
"text": "{{title}}",
"font": "Inter",
"weight": 800,
"size": 72,
"color": "#ffffff",
"animate": {
"in": "slide-up",
"in_at": 0.2
}
},
{
"name": "accent",
"type": "rect",
"x": 0,
"y": 612,
"width": 1200,
"height": 18,
"fill": "#ffd60a",
"animate": {
"in": "wipe-right",
"in_at": 0.6,
"in_duration": 0.8
}
}
]
},
"variables": {
"title": "Launch week starts Monday"
},
"format": "mp4",
"wait": true
}
REQUEST
curl -X POST "https://api.imageapis.com/v1/videos" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"template": {
"width": 1200,
"height": 630,
"background": "#0b1220",
"layers": [
{
"name": "title",
"type": "text",
"x": 72,
"y": 200,
"width": 1056,
"height": 200,
"text": "{{title}}",
"font": "Inter",
"weight": 800,
"size": 72,
"color": "#ffffff",
"animate": {
"in": "slide-up",
"in_at": 0.2
}
},
{
"name": "accent",
"type": "rect",
"x": 0,
"y": 612,
"width": 1200,
"height": 18,
"fill": "#ffd60a",
"animate": {
"in": "wipe-right",
"in_at": 0.6,
"in_duration": 0.8
}
}
]
},
"variables": {
"title": "Launch week starts Monday"
},
"format": "mp4",
"wait": true
}'
import requests
r = requests.post("https://api.imageapis.com/v1/videos", headers={"X-API-Key": "YOUR_KEY"}, json={
"template": {
"width": 1200,
"height": 630,
"background": "#0b1220",
"layers": [
{
"name": "title",
"type": "text",
"x": 72,
"y": 200,
"width": 1056,
"height": 200,
"text": "{{title}}",
"font": "Inter",
"weight": 800,
"size": 72,
"color": "#ffffff",
"animate": {
"in": "slide-up",
"in_at": 0.2
}
},
{
"name": "accent",
"type": "rect",
"x": 0,
"y": 612,
"width": 1200,
"height": 18,
"fill": "#ffd60a",
"animate": {
"in": "wipe-right",
"in_at": 0.6,
"in_duration": 0.8
}
}
]
},
"variables": {
"title": "Launch week starts Monday"
},
"format": "mp4",
"wait": True
})
print(r.status_code, r.headers.get("X-Gw-Remaining"))
print(r.json())
const r = await fetch("https://api.imageapis.com/v1/videos", {
method: "POST",
headers: { "X-API-Key": "YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
"template": {
"width": 1200,
"height": 630,
"background": "#0b1220",
"layers": [
{
"name": "title",
"type": "text",
"x": 72,
"y": 200,
"width": 1056,
"height": 200,
"text": "{{title}}",
"font": "Inter",
"weight": 800,
"size": 72,
"color": "#ffffff",
"animate": {
"in": "slide-up",
"in_at": 0.2
}
},
{
"name": "accent",
"type": "rect",
"x": 0,
"y": 612,
"width": 1200,
"height": 18,
"fill": "#ffd60a",
"animate": {
"in": "wipe-right",
"in_at": 0.6,
"in_duration": 0.8
}
}
]
},
"variables": {
"title": "Launch week starts Monday"
},
"format": "mp4",
"wait": true
})
});
console.log(r.status, r.headers.get("X-Gw-Remaining"));
console.log(await r.json());
RESPONSE
200With response=binary: the file itself, with X-Image-Id and X-Image-Url headers
202Accepted: rendering in the background; the record has status pending and the webhook gets the finished one
{
"id": "vid_6hq2wz8xmtnb4kdc7vre",
"object": "video",
"status": "pending",
"url": "https://img.imageapis.com/i/vid_6hq2wz8xmtnb4kdc7vre.mp4",
"format": "mp4",
"width": 1200,
"height": 630,
"fps": 30,
"duration": 4,
"frames": 120,
"units": 4,
"progress": 0,
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"created": "2026-10-11T20:02:11Z",
"expires": "2026-11-10T20:02:11Z"
}