AI script generation
Turn a brief — or an existing transcript — into a structured, render-ready video script with POST /v1/scripts.
Automating video means automating two things: the script and the
render. POST /v1/renders handles the second;
POST /v1/scripts handles the first. You send a brief plus grounding
parameters — tone, audience, structure, visual style, scene and word bounds,
optionally source material to transform — and get back a validated script:
scenes of narration (voiceText) and image prompts, plus a title and
description.
The endpoint is synchronous: the response carries the finished script,
typically after tens of seconds. Behind the scenes the model is re-prompted
until the draft satisfies every constraint you set, so the shape you receive
is guaranteed — exactly N scenes if you asked for N, every scene within your
word bounds, an imagePrompt on every scene unless you opted out.
Pricing: max(2, ceil(scenes / 4)) credits per script — a 14-scene short
costs 4 credits — charged only on success. A generation that cannot
produce a valid script answers
LLM_FAILED and charges nothing. Your balance is
checked up front, so an underfunded call fails fast with
INSUFFICIENT_CREDITS before any model
work happens.
From a brief
The response:
Every grounding parameter is optional except brief. Omit sceneCount and
the model chooses 10–14 scenes; omit visualStyle and image prompts get a
style of the model's choosing (per-scene coherence is still enforced). The
full parameter reference lives on the
Scripts API page.
From existing material
Pass sourceMaterial — a transcript, article, or notes — and the model
covers the same substance in entirely original wording. Sentences are
never copied; the material is treated strictly as data to transform, and any
instructions embedded in it are ignored.
Script → video
The script's shape maps directly onto a movie document — one scene per
script scene, a voice element from voiceText, an AI-generated background
from imagePrompt, duration: "voice", auto subtitles, and a cycling
motion pan for the ken-burns feel:
See the faceless short guide for the voice +
subtitles recipe in detail, and POST /v1/renders for
polling/webhooks.
Good to know
- Idempotency — send an
Idempotency-Keyheader and retries of the same request return the original script (HTTP 200) instead of generating (and charging for) a new one. Recommended: generation is a long call, and a dropped connection should not cost a second generation. - Fetch it later —
GET /v1/scripts/{id}returns any script you generated. - Usage — script generations appear in
GET /v1/usageunderbreakdown.scriptGens. - Model-authored text —
titleanddescriptioncome from the model. Review before publishing, like any generated copy. - MCP — connected assistants can do this whole pipeline with the
generate_scripttool pluscreate_render.