Key points
- Roleplay needs a long memory, a stable character and a model that stays in the scene.
- Hosted chatbots often break character with warnings; an open-weight model tuned for fewer refusals does so less.
- A 100,000 token context holds very long sessions, and you control the system prompt.
- A 40-turn session costs about $0.07 at $0.15 and $0.50 per 1M tokens.
Yes, and here is where it gets difficult
Can you roleplay with ChatGPT? You can. Ask it to play a ship's captain, a detective or a medieval innkeeper and it will do a fair job for a while. The trouble starts when the story needs conflict, menace, grief or anything morally grey. Then you get a disclaimer in the middle of a scene, a character who suddenly becomes polite and helpful, or a refusal that ends the session.
None of that is a bug from the vendor's point of view. A general assistant serves a very wide audience and its rules reflect that. For roleplay, though, the interruptions are costly, because the whole point is immersion. A single out-of-character paragraph can undo twenty turns of build-up.
This article covers what good roleplay needs from a model, how to set up an uncensored open-weight model through an OpenAI-compatible API, and how to keep a long story coherent and cheap. Everything here is about fiction and companion apps for adults. The one fixed rule is that sexual content involving minors is never allowed.
What roleplay asks of a language model
Roleplay is a harder test than it looks, because it stresses several things at once.
- Memory. The model has to remember names, places, promises and who knows what. In an API this memory is just the message history you send back each turn.
- Voice consistency. A gruff sailor should not drift into the tone of a helpful assistant after ten replies.
- Willingness to follow the scene. If the plot calls for a threat, a betrayal or a bleak ending, the model must write it as fiction instead of steering away.
- Restraint on your turn. Good partners do not decide your character's actions. That behaviour comes mostly from your instructions.
The first and third points are where the choice of endpoint matters. Memory depends on the context window, which here is 100,000 tokens shared between prompt and reply. Willingness depends on how the model was tuned. This service runs one open-weight model tuned to answer lawful adult requests without content refusals, so the scene stays a scene.
Set up the endpoint in two minutes
Any client that accepts a custom OpenAI-compatible endpoint will work. You need the base URL https://api.uncensoredchatgpt.cc/v1, your API key and the model ID uncensored. Chat front ends built for roleplay, such as SillyTavern, let you add an OpenAI-compatible source and paste these values in. If you prefer your own script, this is the smallest useful version:
from openai import OpenAI
client = OpenAI(base_url="https://api.uncensoredchatgpt.cc/v1", api_key="YOUR_API_KEY")
SYSTEM = (
"You are Mara, a smuggler captain in a rain-soaked port city. "
"Stay in character. Write in third person, past tense, two to four paragraphs. "
"Never act or speak for the user's character. Do not add out-of-character notes."
)
history = [{"role": "system", "content": SYSTEM}]
def turn(user_text):
history.append({"role": "user", "content": user_text})
stream = client.chat.completions.create(
model="uncensored",
messages=history,
temperature=0.9,
top_p=0.95,
frequency_penalty=0.3,
stream=True,
)
parts = []
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
piece = chunk.choices[0].delta.content
parts.append(piece)
print(piece, end="", flush=True)
history.append({"role": "assistant", "content": "".join(parts)})
turn("I step onto the pier and ask for the captain by name.")
The pattern is simple: the full history goes up on every call, and you append the reply when it finishes. The docs show the same flow with curl and Node if you work in another language.
Write a system prompt that holds a character
Most weak roleplay comes from a vague system prompt. A short, specific one works better than a long list of rules. Put these elements in this order:
- Who the character is, with two or three concrete traits and one habit of speech. "Mara clips her sentences and never asks questions twice" does more than "Mara is tough".
- The setting and the current situation in two sentences.
- The format: person, tense, length of reply.
- The boundaries on control: the model writes the world and non-player characters, and the user writes their own character.
- A line that says to stay in the fiction and not add disclaimers or commentary.
Keep a separate fact sheet
For long campaigns, keep a short block of facts that must not change, such as names, debts, injuries and the current location. Put it in the system prompt and update it every so often. It is cheaper and more reliable than hoping the model re-reads fifty turns of history for a detail from turn three.
Use the stop parameter for formats
If you write multi-character scripts where each line starts with a speaker name, a stop sequence such as the user character's label keeps the model from continuing into your lines.
Sampling settings that suit fiction
The API passes temperature, top_p, stop, seed and the penalties through, so you can tune the feel of the writing. Starting points that tend to work for narrative:
| Setting | Starting value | Effect |
|---|---|---|
| temperature | 0.8 to 1.0 | Higher gives more varied, riskier prose; lower gives plainer, steadier text |
| top_p | 0.9 to 0.95 | Trims very unlikely words without flattening style |
| frequency_penalty | 0.2 to 0.5 | Reduces repeated phrases across a long scene |
| presence_penalty | 0 to 0.3 | Nudges the story toward new topics |
| seed | fixed number | Helps when you want to compare two prompts side by side |
Change one value at a time. If replies loop or repeat the same gesture ("she raised an eyebrow" for the fifth time), raise the frequency penalty a little before touching temperature. If the story drifts off plot, lower temperature and tighten the system prompt instead.
Long sessions: context and cost
The context window is 100,000 tokens, counting both what you send and what comes back. As a rough guide, one English word is a bit more than one token, so a very long session fits before you need to trim anything. When you do approach the limit, summarise the oldest part of the story into a few hundred tokens and drop the original turns.
Because the whole history is sent every turn, cost grows with the length of the story. Take a realistic case with the prices of $0.15 per 1M input tokens and $0.50 per 1M output tokens. The system prompt is 800 tokens. Each turn you write about 150 tokens and the model answers with 350, so the history grows by 500 tokens a turn.
- Input over 40 turns: 40 x 950 = 38,000, plus 500 x (0 + 1 + ... + 39) = 500 x 780 = 390,000. Total 428,000 tokens, which is $0.0642.
- Output over 40 turns: 40 x 350 = 14,000 tokens, which is $0.007.
- Whole session: about $0.0712, so roughly $0.07.
Forty turns for seven cents. A session twice as long costs more than twice as much, since each turn carries a longer history, but the numbers stay small. Failed or refused requests are not charged. The pricing page has the top-up options. This site takes by crypto (USDT on TRC20, USDC on Base), with credit that never expires.
Common problems and fixes
The character slips into assistant mode. Shorten the system prompt, repeat the format rule at the end of it, and avoid phrases like "you are an AI". Tell the model who it is in the story instead.
It speaks for your character. State the control rule explicitly and end replies with an open moment. A one-line example of a correct reply inside the system prompt helps more than extra rules.
Repetition. Raise the frequency penalty, vary your own input, and trim old turns that contain the repeated pattern.
HTTP 429 in a busy app. The key allows 8 concurrent requests and 300 requests per minute; a trial key allows 2 and 60. A stream keeps its slot until it ends, so always read a stream to the end or close it. On rate_limited, concurrency or a Retry-After: 5 response, wait and retry.
Content you still will not get. Sexual content involving minors is blocked with no exceptions, and the site terms apply. The model is built for lawful adult fiction and companion apps, and that is what the setup above is for.
Try it before you commit
New users can claim $0.50 of trial credit with one click on the API key page after signing up with Google or with email and password. It needs no payment details, is one per person and lasts 7 days. At the numbers above it covers several full sessions, enough to judge voice, memory and pacing with your own characters.
Prompts are not used for training, which matters if your stories or character sheets are personal. Start with one scene you know well, compare it with what you got elsewhere, and decide from the text.
