Best LLM for Roleplay on Janitor AI: Custom API Setup
The best llm for roleplay janitor ai users can pick is the one that keeps long stories coherent, does not break character with refusals, and costs little per message. Janitor AI lets you plug in your own OpenAI-compatible endpoint, so you are not tied to its built-in options.


Key points
- Judge a roleplay backend on context length, refusal behavior, instruction following and price per message.
- Janitor AI accepts a custom OpenAI-compatible URL, key and model name in its API settings.
- Here the model ID is uncensored and the endpoint is https://api.roleplayapi.com/v1.
- At $0.15 per 1M input and $0.50 per 1M output tokens, a long chat turn costs a fraction of a cent.
What a roleplay backend actually needs
Roleplay is a harder workload than a one-off question. The model has to remember who the characters are, keep the tone you set, and continue a scene without drifting. Four properties decide how a backend feels in practice.
- Context length. Every message you send includes the character card, the system prompt and the history. When the total passes the limit, old parts get cut and the character forgets things. A larger window means longer stories before that happens.
- Refusal behavior. A model that stops mid-scene to add warnings or decline breaks immersion. For fiction written by adults, you want a model tuned to follow the story instead of interrupting it.
- Instruction following. Character cards are long instructions. The model must respect formats such as writing in third person or keeping replies short.
- Cost per message. Chats are long, and every turn resends the history, so input tokens add up quickly.
The text on this page stays within one boundary. This service is meant for fiction, roleplay and companion apps for adults, and it has a hard limit: no sexual content involving minors, ever.
Where this endpoint fits
This site offers a hosted, OpenAI-compatible text API for one open-weight model. An independent provider runs it, and it is tuned to answer without content refusals for lawful adult use. It is not the official API of any big model vendor and it is not a router across several models. You get a single model ID, uncensored.
The numbers that matter for roleplay: the context window is 100,000 tokens, covering prompt plus completion. A full key allows 8 concurrent requests and 300 requests per minute. Prompts are not used for training. The model handles text only, so there is no image generation or voice. Whether its writing style suits your characters is a matter of taste, so test it with a few of your own cards before you commit.
For other integration styles, the API for roleplay article covers custom frontends, and there is a separate guide for Discord bots for roleplay.
Step by step: connect it to Janitor AI
First get a key. Sign up with Google or with email and password, then open the API key page. You can claim $0.50 of trial credit with one click, with no card needed. Then configure Janitor AI:
- Open a chat with any character and go to the API or generation settings in the chat menu.
- Choose the custom or proxy option, which is the one that takes your own OpenAI-compatible URL.
- In the model name field, enter
uncensored. - In the URL field, enter
https://api.roleplayapi.com/v1/chat/completions. - In the key field, paste your key. Janitor sends it as a Bearer token.
- Save, reload the chat and send a short message to test.
Menu names change as Janitor AI updates its interface, so look for the field that asks for a proxy or custom URL. Some tools want only the base URL ending in /v1, others want the full chat completions path. If one form fails, try the other.
Before blaming the settings, test the key outside Janitor AI with curl. If this works, the endpoint and key are fine:
curl https://api.roleplayapi.com/v1/chat/completions -H "Authorization: Bearer YOUR_KEY" -H "Content-Type: application/json" -d '{"model":"uncensored","messages":[{"role":"user","content":"Say hello in one sentence."}],"max_tokens":50}'Settings that improve roleplay quality
Frontends usually expose sampling sliders, and the API passes through temperature, top_p, stop, seed and the penalties. A few starting points that many roleplayers use, which you should adjust by feel:
| Setting | Starting value | Effect |
|---|---|---|
| Temperature | 0.7 to 0.9 | Higher gives more varied prose, lower keeps replies steady |
| Top p | 0.9 to 1.0 | Trims unlikely words when lowered |
| Max tokens | 300 to 600 | Caps reply length; optional on this API |
| Frequency penalty | 0 to 0.3 | Reduces repeated phrases in long chats |
If replies end mid-sentence, your frontend's max token setting is too low. If the model repeats itself, raise the penalty slightly or shorten the example dialogue in the character card. Stop sequences are useful to keep the model from writing your character's lines for you.
What a long chat costs
Prices are $0.15 per 1M input tokens and $0.50 per 1M output tokens, paid from prepaid credit. Failed or refused requests are not charged. Say your chat has 6,000 tokens of history, card and system prompt, and the model replies with 400 tokens:
- Input: 6,000 x $0.15 / 1,000,000 = $0.0009
- Output: 400 x $0.50 / 1,000,000 = $0.0002
- Total: $0.0011 per message
That is about $1.10 for 1,000 messages. A very long chat with 40,000 tokens of history costs 40,000 x $0.15 / 1,000,000 = $0.006 for input per turn, plus the reply, so around $0.0062 per message. The history is what costs, which is why trimming bloated character cards saves real money.
The minimum top-up is $20, any whole amount up to $500, with +5% from $50, +10% from $100 and +15% from $200. You can pay with crypto (USDT on TRC20, USDC on Base). Credit never expires. See the pricing page for specifics.
How it compares to other options
There is no single best model for everyone, and it depends on what you value. A large closed-model API may write more polished prose, but it applies its own content policy, which is the reason many roleplayers look for other backends. A self-hosted model gives you full control but needs hardware. A hosted uncensored endpoint sits between the two: no hardware, no refusals on lawful adult fiction, but a single fixed model. If you are weighing a specific big-name option, read our note on Grok API uncensored and check each vendor's current pricing and policy yourself.
A practical test beats any list. Take two or three of your favorite character cards, run the same opening scene on each backend, and compare the first ten replies for consistency, refusals and cost.
More guides
Questions and answers
Does Janitor AI support a custom API?
Yes. It lets you enter your own OpenAI-compatible URL, key and model name in its API settings. The exact menu wording can change between versions.
What model name do I enter?
Enter uncensored. It is the only model ID this endpoint serves.
Why do I get a 429 error in the middle of a chat?
You hit a limit. The error code rate_limited means too many requests per minute, concurrency means too many at once, and a Retry-After header of 5 seconds means temporary overload. Wait a few seconds and resend.
Can I use this for characters that are minors?
No sexual content involving minors is allowed, and the service will not support it. Use the API only for lawful adult use.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.