What an LLM API does in a script pipeline
If you are searching for an llm api for scripts, you probably have a pipeline with a gap in the middle. Ideas and style notes go in at one end, a renderer or an editor sits at the other end, and someone has to write the text between them. An API lets that step run as code. You send a brief, you get back a script, and the next stage picks it up.
This site runs a hosted text model behind an OpenAI-compatible interface. The model ID is uncensored, the methods are POST /v1/chat/completions and GET /v1/models, and auth is a standard bearer key. It is one open-weight model run by an independent provider, tuned to answer without content refusals for lawful adult use. That matters for scripts because a story brief with violence, dark themes or adult relationships should come back as a script, not as a lecture.
It is text only. It does not make video, images or audio, and it has no embeddings. The video side of your workflow stays with whatever tool you already use; for how the text step fits next to it, see the video generation pipeline page. The hard limit is the same everywhere: no sexual content involving minors, under any framing.
A first script request with streaming
Streaming is the right default for writing tasks. A 2,000-word script takes a while to finish, and with stream: true you see text from the first second, can cut a bad run early, and can show progress in a tool. Anything that speaks the OpenAI protocol works; here is Python with the official SDK.
from openai import OpenAI
client = OpenAI(
base_url="https://api.uncensoredvideogenerator.com/v1",
api_key="YOUR_API_KEY",
)
brief = (
"Format: 90-second narrated short.\n"
"Premise: a night-shift lighthouse keeper finds a radio that answers back.\n"
"Tone: slow, uneasy, no jump scares.\n"
"Output: narration lines only, one per line, with [SFX] cues in brackets."
)
stream = client.chat.completions.create(
model="uncensored",
messages=[
{"role": "system", "content": "You are a scriptwriter. Follow the format exactly."},
{"role": "user", "content": brief},
],
temperature=0.9,
stream=True,
stream_options={"include_usage": True},
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
if chunk.usage:
print("\n\ntokens:", chunk.usage.prompt_tokens, chunk.usage.completion_tokens)
Token usage arrives at the end of the stream, which is handy for logging the cost of each script. You do not need to set max_tokens; the completion can use whatever is left of the window. If you want a hard ceiling for a short format, set it anyway.
Sampling settings that suit scripts
Temperature, top_p, stop, seed and the penalties are passed through. For first drafts, a temperature around 0.8 to 1.0 gives varied phrasing. For rewrites that must keep the structure, drop it to 0.3 to 0.5. A seed helps when you want to compare two prompt versions on the same brief, though you should treat repeatability as best effort rather than a guarantee.
Getting scene lists as JSON
Free text is fine for a human reader. A pipeline wants fields. JSON mode (response_format: {"type":"json_object"}) asks the model to return a valid JSON object, which saves you from stripping markdown fences and guessing where the list ends. Tell the model the exact shape you want in the system message, and mention JSON explicitly in the prompt.
import json
resp = client.chat.completions.create(
model="uncensored",
response_format={"type": "json_object"},
temperature=0.6,
messages=[
{"role": "system", "content": (
"Return a JSON object with key 'scenes': a list of objects with "
"'id' (int), 'location' (string), 'duration_s' (int), "
"'narration' (string), 'visual_note' (string)."
)},
{"role": "user", "content": "Break this script into scenes of 8 to 12 seconds:\n\n" + script_text},
],
)
scenes = json.loads(resp.choices[0].message.content)["scenes"]
total = sum(s["duration_s"] for s in scenes)
print(len(scenes), "scenes,", total, "seconds")
Validate anyway. JSON mode gives you parseable JSON, not a promise that every key exists. A short check for the keys you need, with one retry on failure, costs almost nothing. Failed or refused requests are not charged, so a retry loop does not hurt your balance for the failed attempt.
Using tool calling instead
If your stack already defines functions such as add_scene or set_voice, tool calling is an alternative. Pass tools and tool_choice, read the streamed tool_calls, and send results back as role: "tool" messages. For plain scene lists, JSON mode is simpler.
Keeping a series consistent with a 100,000-token window
Most script problems are continuity problems. A character who is a retired pilot in episode one becomes a mechanic in episode four. The context window is how you stop that. It is 100,000 tokens, prompt and completion together, which is roughly the size of a short novel. That is enough for a series bible, the last several episodes and the new brief in one request.
A practical layout for the message list:
- System message: voice rules, format rules, what to avoid.
- A "bible" block: characters, places, running jokes, facts that must not change. Keep it under 3,000 tokens and edit it by hand.
- The last two or three finished scripts, verbatim, as examples of tone.
- The new brief at the end, because models weigh the end of the prompt heavily.
Resist the urge to paste everything. Large prompts cost input tokens on every call, and a model given forty pages of backstory will happily reuse an irrelevant detail. Put in what the new episode needs and a summary of the rest. When the bible changes, change it in one place and let every later run inherit it.
Also watch the budget inside the window. If the prompt is 90,000 tokens, only about 10,000 are left for the answer. A 2,500-token script fits easily, but a full feature-length draft in one call does not. Write long pieces act by act and feed each finished act back in.
Running many scripts in parallel
A batch of 200 episode outlines should not run one after another. A full key allows 8 concurrent requests and 300 requests per minute. A trial key allows 2 concurrent and 60 per minute. Over a limit you get HTTP 429 with the code rate_limited (too many per minute) or concurrency (too many at once). A temporary overload also returns 429, with a Retry-After: 5 header.
One detail catches people: a streamed request holds its concurrency slot until the stream ends. If your worker reads a stream slowly, for example while updating a UI, it keeps the slot busy. For batch jobs, skip streaming or read it quickly.
from concurrent.futures import ThreadPoolExecutor
from openai import OpenAI
client = OpenAI(
base_url="https://api.uncensoredvideogenerator.com/v1",
api_key="YOUR_API_KEY",
max_retries=5, # the SDK backs off on 429 and honors Retry-After
)
def write_script(brief: str) -> str:
r = client.chat.completions.create(
model="uncensored",
messages=[
{"role": "system", "content": "You are a scriptwriter. Follow the format exactly."},
{"role": "user", "content": brief},
],
)
return r.choices[0].message.content
briefs = [f"Episode {n}: write a 60-second narrated short." for n in range(1, 41)]
with ThreadPoolExecutor(max_workers=8) as pool:
scripts = list(pool.map(write_script, briefs))
Keep max_workers at or below your concurrency limit. The response headers X-RateLimit-Limit-Requests and X-RateLimit-Limit-Concurrency tell you the limits for your key, and X-Balance-USD shows what is left, so a batch runner can stop itself before the balance runs out. X-Request-Id is worth logging for every call, because it is the first thing support will ask for.
What a script run costs
Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens, pay as you go from prepaid credit, with no subscription. Take a typical run: a 3,000-token prompt (system message, bible excerpt, brief) and a 2,500-token script.
- Input: 3,000 × $0.15 / 1,000,000 = $0.00045
- Output: 2,500 × $0.50 / 1,000,000 = $0.00125
- Total: $0.0017 per script
At that rate 1,000 scripts cost $1.70. Now the heavy case, where you send a full 100,000-token prompt and get a 4,000-token answer: input is 100,000 × $0.15 / 1,000,000 = $0.015, output is 4,000 × $0.50 / 1,000,000 = $0.002, so $0.017 per call. Fifty of those is $0.85. Long context is affordable, but it adds up if you send it on every call without need.
Scene breakdown passes are cheaper than drafts. Reading a 2,500-token script and returning 600 tokens of JSON costs 2,500 × $0.15 / 1,000,000 = $0.000375 plus 600 × $0.50 / 1,000,000 = $0.0003, about $0.00068.
New users can claim $0.50 of trial credit with one click on the key page after sign-up. It is valid for 7 days and needs no payment, which pays for roughly 290 runs of the first kind. After that, top-ups are any whole amount from $20 to $500, paid in crypto (USDT on TRC20 or USDC on Base), with a bonus of 5% from $50, 10% from $100 and 15% from $200. Credit never expires. The pricing page has the full table, and you can get an API key in a minute.
Rules and limits to plan around
Three limits shape what you build. The model is text only, so image prompts and shot lists are text you hand to another tool. It does not remember earlier requests; every call needs the context you want it to use. And it is one model, so you cannot switch to a different family for a different task.
On content: the model is tuned for lawful adult use and will not refuse dark or mature fiction by reflex, but it will not produce sexual content involving minors, and your own pipeline should block it as well. Prompts are not used for training. For endpoint details and a copy-paste test call, the quickstart in the docs is the reference to keep open.
