EN ▾

OpenAI-compatible uncensored API

https://api.uncensoredais.com/v1uncensored

Claim trial key

Uncensored AI Scripter: Write Scripts with an LLM API

An uncensored ai scripter is a small program that asks a text model to draft scripts: screenplay scenes, dialogue, video outlines or automation snippets. This article shows the prompt patterns and a batch loop you can copy.

Last updated

A conveyor belt carrying glowing dialogue blocks from a clapperboard into trays, showing batch script generation

What a scripter does

The word scripter is used for two jobs. One is writing scripts in the screenplay sense: scenes, dialogue, sketches, narration for videos. The other is writing code scripts: shell, Python or automation glue. A text model can draft both. This guide builds an uncensored ai scripter for the first meaning and notes where the second differs.

The reason to use a model without content refusals for lawful adult use is practical. Fiction needs villains, crime, dark humour and morally grey characters, and a model that refuses or waters those down makes the first draft useless. This is for adult, lawful writing only, and content involving minors is never allowed.

A prompt pattern that works

Scripts come out best when the prompt has four parts. Put the fixed parts in the system message and the changing parts in the user message.

  1. Role. "You are a screenwriter for short web series."
  2. Format. Say exactly how a line should look: character name in capitals, then the line, then action in brackets.
  3. Constraints. Length, tone, number of characters, what must not happen.
  4. Example. One short sample of the output you want. Models copy examples closely.

Here is a system prompt built that way.

You are a screenwriter for short web series.

Format: one line per beat. "NAME: line" for dialogue, "(action)" for stage directions.

Keep each scene under 250 words. Maximum three speaking characters.

Tone: dry, tense, little exposition. Do not summarise the scene at the end.

Example: "(A rain-soaked loading dock. Night.) RIVA: You said the truck would be here at nine. OSKAR: Nine, yes. Whose truck, no."

Use a temperature around 0.8 for dialogue and 0.3 for code-style scripts. Set a seed if you want repeatable drafts while you tune the wording.

One request, with JSON output

When a script feeds another program, ask for JSON. The API supports JSON mode with response_format. Describe the keys in the prompt as well, because JSON mode asks for a JSON object, not for your exact schema, so always validate the keys in code.

import os, json
from openai import OpenAI

client = OpenAI(
    base_url="https://api.uncensoredais.com/v1",
    api_key=os.environ["API_KEY"],
)

SYSTEM = (
    "You are a screenwriter for short web series. Reply with a JSON object with keys "
    "'title' (string), 'setting' (string) and 'lines' (array of objects with 'speaker' and 'text'). "
    "Max 12 lines, tense and dry tone."
)

def draft(premise):
    r = client.chat.completions.create(
        model="uncensored",
        temperature=0.8,
        response_format={"type": "json_object"},
        messages=[
            {"role": "system", "content": SYSTEM},
            {"role": "user", "content": premise},
        ],
    )
    return json.loads(r.choices[0].message.content)

print(draft("Two smugglers argue over a missing shipment."))

A batch loop that respects the limits

For many scenes, run a small worker pool. A full key allows 8 concurrent requests and 300 requests per minute, and a trial key allows 2 and 60. Stay below that with a modest pool, and retry when the API answers 429. The response carries error code concurrency or rate_limited, and on temporary overload a Retry-After: 5 header.

import os, json, time
from concurrent.futures import ThreadPoolExecutor
from openai import OpenAI, RateLimitError

client = OpenAI(
    base_url="https://api.uncensoredais.com/v1",
    api_key=os.environ["API_KEY"],
)

def draft(premise, retries=5):
    for attempt in range(retries):
        try:
            r = client.chat.completions.create(
                model="uncensored",
                temperature=0.8,
                response_format={"type": "json_object"},
                messages=[
                    {"role": "system", "content": "Reply as JSON with keys title, setting, lines (speaker, text)."},
                    {"role": "user", "content": premise},
                ],
            )
            return json.loads(r.choices[0].message.content)
        except RateLimitError:
            time.sleep(5 * (attempt + 1))
    return None

premises = [line.strip() for line in open("premises.txt") if line.strip()]

with ThreadPoolExecutor(max_workers=4) as pool:
    results = list(pool.map(draft, premises))

with open("scenes.json", "w") as f:
    json.dump(results, f, indent=2)

Four workers leave headroom under the 8-slot limit for a second job. Failed or refused requests are not charged, so retries cost nothing extra. For production-grade behaviour such as logging and backoff, see the production checklist.

Keeping continuity across scenes

Scenes written one by one drift: a character changes speech habits, a prop disappears, a place is renamed. The model keeps nothing between calls, so continuity is your job. Two small files solve most of it.

  • A story bible. A fixed block of 300 to 500 tokens in the system prompt: names, ages, how each person talks, the setting and any hard facts. Edit it by hand.
  • A running recap. After each scene, ask for a three-sentence summary and send the last few recaps with the next premise.

Cost stays tiny. A call with a 500-token bible, 300 tokens of recaps and a 200-token premise sends 1,000 input tokens. With 1,200 tokens of output that is 1,000 x $0.15 / 1,000,000 + 1,200 x $0.50 / 1,000,000 = $0.00015 + $0.0006 = $0.00075 per scene.

Generate scenes in order when continuity matters, and in parallel only when they stand alone. A parallel batch is faster but cannot see the recap of the scene before it.

What a batch costs

Say each scene draft uses 600 input tokens (system prompt plus premise) and produces 1,200 output tokens.

  • Input: 600 x $0.15 / 1,000,000 = $0.00009
  • Output: 1,200 x $0.50 / 1,000,000 = $0.0006
  • Per draft: $0.00069
  • 200 drafts: $0.138
  • 2,000 drafts: $1.38

So a season of web-series scenes costs less than a coffee. The trial credit of $0.50 covers roughly 700 drafts of this size. Rates are on the pricing page.

Quality control for drafts

Batch output varies, so build in a cheap review step.

  • Ask for variants. Request three versions of the same scene at different temperatures and keep the best. Three drafts at $0.00069 each cost about $0.002.
  • Run an edit pass. Feed the draft back with a short instruction such as "tighten to 150 words, keep every plot point". With 1,200 tokens in and 1,200 out, that costs $0.00018 + $0.0006 = $0.00078 per pass.
  • Check the shape in code. Reject any result that is not valid JSON, has more lines than allowed, or repeats a line from the previous scene.
  • Keep a log. Save the premise, the prompt version and the output together. When a prompt change makes things worse, you will want the old results to compare.

Treat the model as a fast first-draft writer. A person still decides what ships.

If you mean automation scripts

For shell and Python snippets, the same pattern applies with three changes. Lower the temperature to 0.2 or 0.3. Ask for code only, in one fenced block, with no commentary. And never run generated code without reading it. A model can produce a plausible command that deletes the wrong folder, so review and test in a safe directory first.

Start by generating a key on the API key page, and check the docs for parameters such as stop, which is useful for cutting output at a marker.

FAQ

What does a scripting tool built on an uncensored model do?

It is a script or app that sends prompts to a text model without content refusals for lawful adult use, and collects drafted dialogue, scenes or code. Here you build one with a normal OpenAI SDK.

How many scripts can I generate at once?

A full key allows 8 concurrent requests and 300 per minute. A trial key allows 2 and 60. A worker pool of 4 is a safe start.

How do I get parseable output?

Set response_format to json_object and describe the keys in your prompt. Parse the reply with json.loads and handle the rare invalid case.

Can it write code scripts too?

Yes, but lower the temperature and review everything before running it. The service is text only, so it returns code as text.

Get your key instantly

Register, retrieve your key, and update the endpoint. That is all.

Summary

  • Give the model a format, a role, constraints and an example, and scripts come back usable.
  • JSON mode makes batch output easy to parse and store.
  • Respect the 8-concurrent limit and retry on 429 using Retry-After.
  • 200 scene drafts of about 1,200 tokens each cost roughly $0.14.

Begin with trial funds

Enter email and password to get your key immediately.