AI Video Script Maker via API: Scripts, Scene Lists
An ai video script maker built on a text API writes the words and the plan: the script, a scene list and the caption text. It does not render video. This guide gives you a prompt template, Python code that returns structured JSON, and the cost per batch.


Key points
- The API is text only, so it produces scripts, shot lists and captions that you feed to your own editing or video tools.
- JSON mode returns a scene list your code can loop over instead of text you must parse by hand.
- A 150-word script with a scene list costs roughly $0.0005, so 100 scripts cost about $0.05.
- Lawful adult use only, fiction and stylised content are fine, and nothing involving minors is ever allowed.
What a script maker can and cannot do
An ai video script maker is the planning half of video work. A language model is good at turning an idea into a hook, a narration, a list of scenes and short on-screen captions. It cannot produce pictures or footage. This service is a hosted, OpenAI-compatible text API with one model, uncensored. It has no image, audio or video generation, no embeddings and no fine-tuning.
So the realistic pipeline has two stages. First the text API writes the script and scene list. Then you hand those to whatever tool you use for visuals, voice and editing. If you are looking for the visual side, the page about video generation APIs explains how that differs from this service.
The model is open-weight and run by an independent provider; it is not the official product of any other vendor. It is tuned to answer without content refusals for lawful adult use, which helps when your scripts cover mature fiction, dark comedy or horror shorts. Anything involving minors in a sexual context is blocked as a hard rule.
A prompt template that returns a usable script
Vague prompts give vague scripts. The template below pins down format, length and structure, so you can reuse it across topics. Replace the bracketed parts.
You are a video scriptwriter. Write a [30 / 60 / 90] second script about [topic] for [platform] aimed at [audience]. Tone: [tone]. Begin with a hook of at most 12 words. Return JSON with the keys title, hook, scenes, caption and hashtags. Each scene has number, duration_seconds, narration, visual and on_screen_text. Keep total narration under [words] words.
Why this works:
- Duration and word limit. Spoken English runs at about 150 words per minute, so a 60 second video needs about 150 words of narration. State the number; models do not count seconds on their own.
- Hook first. Putting the opening line in its own field forces the model to treat it as a separate job.
- Visual notes as plain text. The
visualfield is a description for you or for another tool, not an instruction the text model carries out. - Fixed keys. Predictable names let your code read the result without guessing.
Python script: topic in, scene list out
This script calls the API in JSON mode and writes each scene to a file. It uses the standard OpenAI SDK with the service's base URL.
import json
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.nsfwvideo.cc/v1",
api_key=os.environ["API_KEY"])
TEMPLATE = (
"You are a video scriptwriter. Write a {secs} second script about {topic} "
"for {platform}, audience: {audience}. Tone: {tone}. "
"Start with a hook of at most 12 words. Keep narration under {words} words. "
"Reply only with JSON using the keys title, hook, scenes, caption, hashtags. "
"Each scene has number, duration_seconds, narration, visual, on_screen_text."
)
def make_script(topic, secs=60, platform="short vertical video",
audience="general adults", tone="dry humour"):
prompt = TEMPLATE.format(secs=secs, topic=topic, platform=platform,
audience=audience, tone=tone, words=int(secs * 2.5))
r = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": prompt}],
response_format={"type": "json_object"},
temperature=0.8,
max_tokens=1200,
)
return json.loads(r.choices[0].message.content)
script = make_script("why night buses feel like another country")
print(script["title"])
for s in script["scenes"]:
print(s["number"], s["duration_seconds"], s["narration"])
with open("script.json", "w") as f:
json.dump(script, f, indent=2)
Two details. JSON mode needs the word "JSON" in the prompt, which the template already contains. And you should still validate the result: check that scenes is a list and that durations sum to roughly the length you asked for. If parsing fails, retry once with a lower temperature.
The equivalent curl call, handy for testing in a terminal:
curl https://api.nsfwvideo.cc/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"uncensored","response_format":{"type":"json_object"},"messages":[{"role":"user","content":"Reply in JSON: a 3-scene outline for a 30 second video about cold brew coffee."}]}'Scene lists, captions and variations
Once the first script works, add smaller jobs. Each one is a separate call with a narrow prompt, which is cheaper and easier to fix than one giant request.
Expand one scene
Send a single scene and ask for three alternative narrations in different tones. You choose the winner; nothing downstream breaks.
Caption and subtitle text
Give the narration and ask for on-screen text broken into lines of at most 42 characters, two lines at a time. Subtitle tools accept plain lines, so you can paste the result straight in.
Variations for testing
Run the same topic with three hooks and compare them in your analytics. Use a different seed per variant if you want repeatable results later; the seed parameter is passed through.
Series planning
Ask for ten episode ideas for a channel theme, then generate scripts for the best three. This keeps episodes consistent because you can paste the series outline into every prompt as shared context.
Cost of a script and of a batch
Prices are $0.15 per 1M input tokens and $0.50 per 1M output tokens. A typical script call has about 600 input tokens (the template plus your topic and any style notes) and about 900 output tokens (the JSON with narration, scene notes and captions).
- Input: 600 x $0.15 / 1,000,000 = $0.00009
- Output: 900 x $0.50 / 1,000,000 = $0.00045
- Per script: $0.00054
- 100 scripts: $0.054
- 1,000 scripts: $0.54
The $0.50 trial credit therefore covers about 925 scripts of this size. Failed or refused requests are not charged. Credit is prepaid and never expires, with no subscription. Whole-amount top-ups run from $20 to $500, with +5% from $50, +10% from $100 and +15% from $200. Payment is crypto only, in USDT on TRC20 or USDC on Base; the pricing page has the details.
The output side is where the money goes, so set max_tokens to a sensible ceiling and ask for concise scene notes.
Running a batch without hitting limits
For a content calendar you may want fifty scripts at once. Keep the worker count at or below your concurrency limit: 8 on a full key, 2 on a trial key. Requests per minute are capped at 300 on a full key and 60 on a trial key.
from concurrent.futures import ThreadPoolExecutor
import json, os, time
from openai import OpenAI, RateLimitError
client = OpenAI(base_url="https://api.nsfwvideo.cc/v1",
api_key=os.environ["API_KEY"])
def one(topic):
for attempt in range(4):
try:
r = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user",
"content": f"Reply in JSON with keys title, hook, scenes. 45 second script about {topic}."}],
response_format={"type": "json_object"},
max_tokens=900,
)
return json.loads(r.choices[0].message.content)
except RateLimitError:
time.sleep(5)
return None
topics = ["budget travel hacks", "a haunted vending machine", "how espresso works"]
with ThreadPoolExecutor(max_workers=2) as pool:
results = list(pool.map(one, topics))
A 429 response carries the code rate_limited or concurrency, and a temporary overload adds Retry-After: 5, which is why the sleep above is five seconds. Check the X-Balance-USD header from time to time so a long batch stops before credit runs out. More parameters are documented in the API docs, and the Open WebUI setup page shows how to use the same endpoint in a chat interface for quick one-off scripts.
Review the output before you publish
A script maker saves hours, but it does not replace an editor. Read each script aloud once. Awkward phrasing shows up the moment you speak it, and you can ask the model to fix just that line.
- Check facts. If the script states numbers, dates or claims about real people, verify them yourself. The model can write confident sentences that are wrong.
- Check timing. Add up the scene durations. If they overshoot, ask for the same script cut by 20 percent rather than rewriting it.
- Keep a style sheet. Store your tone notes, banned phrases and recurring characters in one text block and paste it at the top of every prompt. Consistency across a channel comes from that block more than from any single script.
- Keep it lawful. Mature fiction for adult audiences is fine. Content involving minors in a sexual context is never allowed, and you remain responsible for what you publish.
Get started
Sign up with Google or with email and password, open the API key page and claim the $0.50 trial with one click. It needs no payment details, one claim per person, valid for 7 days. Set the base URL to https://api.nsfwvideo.cc/v1, use model uncensored, and run the script above. Prompts are not used for training, so your ideas and unreleased concepts are not fed back into a model.
More guides
Questions and answers
Can this API generate the video itself?
No. It is text only and returns scripts, scene lists, captions and prompts. You pass those to separate tools for images, voice and editing.
How long should the narration be for a 60 second video?
About 150 words at a natural speaking pace. Put the word limit in the prompt, because models do not measure seconds reliably.
How much does it cost to generate 100 video scripts?
Around $0.054 for scripts of about 600 input and 900 output tokens each, at $0.15 and $0.50 per 1M tokens.
Can I get the scene list as structured data?
Yes. Use JSON mode with response_format set to json_object and name the keys in your prompt, then parse the result in your code.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.
Get API key