Developers
API, webhooks and MCP.
Make documentary videos from your own code, n8n, Zapier or an AI assistant. Same rules, prices and checks as the app. On paid plans (Starter and up).
Quick start
Create a key, check the price, start a video.
In VidDrift, open Settings and create a key under API keys. It is shown once; we keep only a hash. You can keep up to 10 keys and revoke any of them at once. Send it on every request:
Authorization: Bearer vd_live_...curl -s https://viddrift.com/api/v1/estimate \
-H "Authorization: Bearer $VIDDRIFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"length_minutes": 12, "extra_languages": ["es"]}'curl -s https://viddrift.com/api/v1/videos \
-H "Authorization: Bearer $VIDDRIFT_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"topic": "The lighthouse keepers of Flannan Isles", "length_minutes": 12, "auto_approve": true}'curl -s https://viddrift.com/api/v1/videos/VIDEO_ID -H "Authorization: Bearer $VIDDRIFT_API_KEY"
curl -s https://viddrift.com/api/v1/videos/VIDEO_ID/downloads -H "Authorization: Bearer $VIDDRIFT_API_KEY"Want to read the script first? Leave out auto_approve, wait for status script_ready, read /videos/VIDEO_ID/script, then call /videos/VIDEO_ID/approve. Or set a webhook and skip the polling.
Endpoints
Base URL: https://viddrift.com/api/v1. JSON in, JSON out, snake_case fields.
POST /estimate
Minutes a video of this length would reserve, and what that is worth on your plan. Free.
POST /videos
Start a video from a topic. Needs an Idempotency-Key. The script is written first and costs nothing.
GET /videos/:id
Status, current stage, progress (0 to 1) and cost in minutes.
GET /videos/:id/script
The written script: chapters, scenes and narration.
POST /videos/:id/approve
Approve the script and start the render. Needs an Idempotency-Key. Reserves the minutes.
GET /videos/:id/downloads
Signed links to the finished files. They expire after 10 minutes; ask again for fresh ones.
GET /me
Your plan, minutes left and which key you are using.
{
"topic": "required, 3-300 characters",
"length_minutes": 12, // required
"angle": "optional: the question the video answers",
"language": "en", // narration language
"voice": "std-deep | std-warm | std-low | std-bright",
"style": "archival-dark | cold-mystery | clean-documentary | sleep-soft | storybook-comic | painted-realism | warm-film",
"music": "auto | tense | sombre | wonder | calm | driving | none",
"captions": "karaoke | line | off",
"footage": "archive+stock | archive | stock | stills",
"auto_approve": false // or true, or { "extra_languages": ["es"], "accept_flags": false }
}{
"video": {
"id": "0190f0f0-...",
"status": "rendering", // outlining, script_ready, queued, rendering, done, failed
"stage": "voice",
"progress": 0.42,
"cost": { "minutes": 14, "basis": "reserved" }, // estimate, reserved, charged or released
"auto_approve": { "status": "started", "error": null },
...
}
}Approve takes extra_languages, accept_flags (approve even if some lines could not be matched to a source) and an optional script_version. Minutes are reserved on approval and settled on the finished length; unused minutes go back.
Retries without duplicates
Creating and approving need an Idempotency-Key header.
Pick any unique string (8 to 200 characters, a UUID is ideal) per video or approval. If the connection drops, send the same request with the same key: you get the first answer back, with Idempotent-Replayed: true, and no second video or second charge. Reusing a key for a different request is a 422. Keys are kept for 7 days.
Errors and limits
{ "error": { "code": "VALIDATION", "message": "Some fields are not valid.", "details": { "fieldErrors": { "length_minutes": ["..."] } } } }401 UNAUTHORIZED
No key, a malformed key, or a revoked key.
403 PLAN_REQUIRED
The account is on Free. The API is on paid plans.
403 FORBIDDEN
The account is suspended.
404 NOT_FOUND
No such video on your account.
409 INVALID_STATE
Not possible right now, for example approving before the script is written.
409 CONFLICT
script_version did not match: the script changed since you read it.
402 INSUFFICIENT_CREDITS
Not enough minutes for this render.
422 VALIDATION
A field is missing or wrong; details.fieldErrors says which.
429 RATE_LIMITED
Too many requests. Wait for the Retry-After header's seconds.
500 INTERNAL
Our fault. Retry with the same Idempotency-Key.
Limits: 60 requests a minute per key. Creating and approving also count toward your account's 20 generations an hour, and your plan's video length, language and in-progress caps apply as in the app.
Webhooks
One HTTPS address per account, set in Settings. We POST JSON when something happens.
video.script_readyvideo.completedvideo.failed
POST https://your-server.example/hooks/viddrift
Content-Type: application/json
VidDrift-Signature: t=1767225600,v1=5f2b...
VidDrift-Event: video.completed
VidDrift-Delivery: 0190f0f1-...
{ "id": "0190f0f1-...", "type": "video.completed", "created_at": "2026-01-01T00:00:00.000Z",
"data": { "video": { "id": "0190f0f0-...", "status": "done", "title": "...", "topic": "..." }, "error": null } }Verify every request: v1 is the HMAC-SHA256 of `${t}.${raw body}` with your signing secret (shown once in Settings), in hex. Refuse anything older than 5 minutes. Use VidDrift-Delivery to ignore a repeat.
import { createHmac, timingSafeEqual } from "node:crypto";
// rawBody: the request body exactly as received (a string), before JSON.parse.
export function verifyVidDrift(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(",").map((p) => p.trim().split("=")));
const t = Number(parts.t);
if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false; // too old: replay
const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
const got = Buffer.from(parts.v1 ?? "", "hex");
return got.length === 32 && timingSafeEqual(got, Buffer.from(expected, "hex"));
}
// Express: app.post("/hooks/viddrift", express.text({ type: "application/json" }), (req, res) => {
// if (!verifyVidDrift(req.body, req.get("VidDrift-Signature") ?? "", process.env.VIDDRIFT_WEBHOOK_SECRET)) return res.sendStatus(400);
// const event = JSON.parse(req.body); // { id, type, created_at, data: { video: { id, status, title, topic }, error } }
// res.sendStatus(200);
// });Answer with any 2xx within 10 seconds. Anything else is retried after 30 s, 2 min, 10 min, 1 h, 6 h, 24 h, then marked failed; Settings shows the last deliveries. Redirects are not followed, and addresses that resolve to private networks are refused.
MCP for AI assistants
Let Claude, Cursor or any MCP client estimate, create, approve and download videos with your key.
Remote server (Streamable HTTP): https://viddrift.com/api/mcp with the same Authorization: Bearer key. Tools: estimate_video, create_video, get_video, get_script, approve_script, get_downloads. They follow the same rules and limits as the REST API.
{
"mcpServers": {
"viddrift": {
"url": "https://viddrift.com/api/mcp",
"headers": { "Authorization": "Bearer vd_live_..." }
}
}
}{
"mcpServers": {
"viddrift": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://viddrift.com/api/mcp", "--header", "Authorization:${VIDDRIFT_AUTH}"],
"env": { "VIDDRIFT_AUTH": "Bearer vd_live_..." }
}
}
}A key in a config file can spend your minutes. Make a separate key for each assistant so you can revoke one without touching the others.