EN ▾

Best Chatbot for Roleplay: What to Look For

The best chatbot for roleplay is the one that stays in the scene: it keeps your character straight, remembers what happened 200 messages ago and does not interrupt the story with a lecture. Here is how to judge that, and how to build it on an uncensored API.

Updated

Stage with floating masks, a glowing book and dice, representing character roleplay with a chatbot

What roleplay asks of a chatbot

Roleplay is a harder test than question answering. The bot has to play a character for hours, hold a plot together, match your pacing and write in a voice that does not drift. When people say they want the best chatbot for roleplay, they usually mean five concrete things.

  1. It does not break the scene. Fiction includes villains, grief, violence and romance. A model that stops the story to refuse or add a disclaimer ends the session.
  2. It remembers. A character who forgets a promised debt or a scar is hard to take seriously.
  3. It follows a character definition. Name, voice, goals, speech habits and boundaries need to hold from the first message to the last.
  4. It writes with variety. Repeated phrasing and recycled openings make long sessions feel stale.
  5. It is cheap enough to use daily. A good hobby tool should not cost like a subscription you hesitate to open.

Ready-made roleplay apps cover some of this. If you are a developer, or you want to wire your own front end, an API gives you control over every item on the list. The rest of this article shows how that works with an OpenAI-compatible endpoint.

Why the lack of refusals matters for fiction

Mainstream assistants are tuned for broad public use, and their refusal rules are a poor fit for storytelling between adults. A crime thriller needs a convincing antagonist. A horror campaign needs dread. A romance or companion character needs emotional range. When a hosted model refuses or waters down a scene that is lawful, you lose the thread and have to start over.

This API serves one open-weight model, run by an independent provider and tuned to answer without content refusals for lawful adult use. It is not the official API of any big vendor and it is not a router across several models, so behavior is consistent from one request to the next. That consistency is useful: you can tune a character prompt once and expect the same temperament tomorrow.

There is one hard limit that no setting changes. Sexual content involving minors is not allowed, and a roleplay app built on this API should state that rule in its own terms and enforce age gating on its side. Everything here is about fiction, roleplay and companion apps for adults.

Setting up a character with a system prompt

Most roleplay quality comes from the system prompt. Write it as a short character sheet plus a few rules about format. Be specific about voice, because vague instructions give vague writing.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.nsfwchatbot.cc/v1",
    api_key=os.environ["NSFWCHATBOT_API_KEY"],
)

SYSTEM = '''You play Mara Voss, a smuggler captain in a rain-soaked port city.
Voice: dry, clipped, quietly funny. She never explains herself twice.
Goal: keep the crew alive and the debt to the Harbor Guild unpaid.
Format: write in third person, past tense, two to four short paragraphs.
Never speak or act for the user's character. Stay in the story.'''

history = [{"role": "system", "content": SYSTEM}]

def say(user_text):
    history.append({"role": "user", "content": user_text})
    r = client.chat.completions.create(
        model="uncensored",
        messages=history,
        temperature=0.9,
        top_p=0.95,
        max_tokens=400,
    )
    reply = r.choices[0].message.content
    history.append({"role": "assistant", "content": reply})
    return reply

print(say("I step onto the deck and ask Mara where the cargo is."))

Three details earn their keep. The line about not speaking for the user prevents the most common complaint in text roleplay. A temperature near 0.9 gives varied prose, and you can lower it to 0.7 if the bot rambles. The penalties (frequency_penalty, presence_penalty) are passed through, so a small value like 0.3 helps against repeated phrasing in long sessions. A seed is also passed through if you need reproducible tests of a prompt change.

Streaming makes chat feel alive. Add stream=True and print chunks as they arrive. The integration docs list every parameter that is supported.

Memory: using the 100,000-token window well

The context window is 100,000 tokens for prompt plus reply. At roughly 400 tokens per exchange, that is on the order of 200 exchanges before you need to cut anything. For most stories, that means no summarizing for a long time. Use the room, but keep two habits.

First, pin the important facts. Put a short "story so far" block and a list of fixed facts (names, injuries, promises) into the system message and update it every 30 or 40 turns. A model pays more attention to a compact, clear block than to a detail buried in message 87.

Second, trim from the middle. When the history nears 60,000 tokens, replace the oldest 20 turns with a 200-word summary written by the model itself. Keep the first messages (they set tone) and the last 20 (they set the moment).

Every request resends the history, and input tokens are billed each time. That is cheap per call but it compounds, as the cost section below shows.

Game state with tool calling

Text roleplay gets more interesting when the world has rules. Dice, hit points, inventory and reputation should live in your code, not in the model's head, because models drift on arithmetic and bookkeeping. Tool calling solves this. The API supports tools and tool_choice, streamed tool_calls and tool results as role: "tool" messages.

import json, random

tools = [{
    "type": "function",
    "function": {
        "name": "roll_check",
        "description": "Roll a d20 skill check and return the number.",
        "parameters": {
            "type": "object",
            "properties": {"skill": {"type": "string"}},
            "required": ["skill"],
        },
    },
}]

def turn(user_text):
    history.append({"role": "user", "content": user_text})
    r = client.chat.completions.create(model="uncensored", messages=history, tools=tools)
    msg = r.choices[0].message
    if msg.tool_calls:
        history.append(msg)
        for call in msg.tool_calls:
            skill = json.loads(call.function.arguments)["skill"]
            history.append({
                "role": "tool",
                "tool_call_id": call.id,
                "content": f"{skill} check: {random.randint(1, 20)}",
            })
        r = client.chat.completions.create(model="uncensored", messages=history, tools=tools)
        msg = r.choices[0].message
    history.append({"role": "assistant", "content": msg.content})
    return msg.content

When the player tries to pick a lock, the model asks for a check, your code rolls the die, and the model narrates the result. The same pattern works for a health counter, a shop inventory or an affection meter in a companion app. Keep the state in a database and send the model only the summary it needs.

What a session costs

Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens, billed from prepaid credit with no subscription. Take a session of 50 turns with a 1,000-token character prompt, 100-token player messages and 300-token replies. Each turn adds 400 tokens of history.

  • Input per turn n = 1,000 + 400 x (n - 1) + 100.
  • Total input = 50 x 1,100 + 400 x (0 + 1 + ... + 49) = 55,000 + 400 x 1,225 = 545,000 tokens.
  • Total output = 50 x 300 = 15,000 tokens.
  • Cost = 545,000 x $0.15 / 1M + 15,000 x $0.50 / 1M = $0.08175 + $0.0075 = $0.08925.

About 9 cents for 50 turns of back-and-forth. A $20 top-up, the minimum, covers around 220 sessions of that size ($20 / $0.08925 is about 224). Failed or refused requests are not charged, and credit never expires, so unused balance simply waits. Check the pricing page for bonus tiers on larger top-ups and the accepted crypto payment options (USDT on TRC20, USDC on Base).

Limits and honest trade-offs

No single tool is the best chatbot for every roleplayer, so here is where this approach falls short.

  • It is an API, not an app. You need a front end. Several community front ends, SillyTavern among them, let you add an OpenAI-compatible endpoint, so you can paste the base URL, key and the model name uncensored instead of writing code.
  • Text only. No image, voice or video generation. If your app shows portraits, you need a separate image service; the text layer guide explains how the chat side fits into such a stack.
  • One model. You cannot pick between several styles. Tune with the system prompt and sampling settings.
  • Concurrency. A full key allows 8 concurrent requests and 300 per minute. A streamed reply holds its slot until it ends, so a public app with many users needs queueing.

To try it before topping up, sign up and use the one-click $0.50 trial on the API key page. That is valid for 7 days, needs no payment details, and covers several full sessions at the cost above (about five, since $0.50 / $0.08925 is 5.6). Prompts are not used for training.

Questions and answers

Can I use this with SillyTavern or a similar front end?

Front ends that accept an OpenAI-compatible endpoint can usually connect. Enter your base URL, your key and the model name uncensored in their API settings.

How long can a roleplay session get?

The context window is 100,000 tokens, which fits roughly 200 exchanges of typical length. Beyond that, summarize old turns.

Is there any content the model will not write?

Sexual content involving minors is never allowed. Otherwise it is tuned to answer without content refusals for lawful adult use.

Does it generate images for characters?

No. It is text only, with no image, audio or video generation.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key