EN ▾
Get API key
uncensoredimage.cc

Updated

Custom Image Roleplay Community: Run Bots on a Text API

A custom image roleplay community usually has two halves: pictures and prose. This API covers the prose half only. It is a text model with no content refusals for lawful adult use, reachable through a standard OpenAI-compatible endpoint, and it can drive the characters, the narrator and the scene memory of your bot.

Floating masks and glowing speech bubbles on a small stage, representing a roleplay community powered by a text API

Who this is for and what it covers

Communities that run collaborative fiction, character chat and companion-style bots for adults tend to hit the same wall with mainstream APIs: the model refuses or waters down scenes that are lawful and fully within the rules of the group. This service runs one open-weight model, hosted by an independent provider, tuned to answer without content refusals for lawful adult use.

It is text only. Your community may share generated artwork, avatars or character portraits, and that is a different tool. The text API can help with that side by writing character descriptions, scene captions and prompts for an image generator, but it does not render pictures. One rule has no exception: no sexual content involving minors. If you run a community, enforce adult-only membership and write that into your rules.

Connect a ready-made frontend

You do not have to write code. Many roleplay frontends, SillyTavern among them, let you add an OpenAI-compatible endpoint. The pattern is the same everywhere:

  1. Choose the OpenAI-compatible or custom chat-completion source.
  2. Set the base URL to https://api.uncensoredimage.cc/v1.
  3. Paste your key from the API key page.
  4. Enter the model name uncensored and connect.

Frontends like these expose sampling settings. The API passes through temperature, top_p, stop, seed and the frequency and presence penalties, so the sliders you are used to will work. For fiction, a temperature a bit above the default and a small presence penalty usually keep scenes from looping. Tune it by reading actual output rather than copying numbers.

Build a shared bot for a channel

If your group lives in Discord, Telegram or a forum with a bot, a few ideas matter more than the platform. Each channel is one scene. Each scene has a persona prompt, a short rolling transcript, and a running summary of everything older. The code below shows that core without any chat-platform specifics; plug reply() into your platform's message handler.

import asyncio
import os
from openai import AsyncOpenAI

client = AsyncOpenAI(
    base_url="https://api.uncensoredimage.cc/v1",
    api_key=os.environ["API_KEY"],
)
gate = asyncio.Semaphore(6)  # a full key allows 8 concurrent requests


class Scene:
    def __init__(self, persona: str, rules: str):
        self.persona = persona
        self.rules = rules
        self.summary = ""
        self.recent = []  # list of chat messages

    def system(self) -> str:
        memo = f"\nStory so far: {self.summary}" if self.summary else ""
        return f"{self.persona}\n\nGround rules: {self.rules}{memo}"

    async def reply(self, author: str, text: str) -> str:
        self.recent.append({"role": "user", "content": f"{author}: {text}"})
        async with gate:
            r = await client.chat.completions.create(
                model="uncensored",
                messages=[{"role": "system", "content": self.system()}] + self.recent,
                temperature=0.9,
                presence_penalty=0.3,
                max_tokens=400,
            )
        out = r.choices[0].message.content or ""
        self.recent.append({"role": "assistant", "content": out})
        if len(self.recent) > 16:
            await self.compress()
        return out

    async def compress(self):
        old, self.recent = self.recent[:10], self.recent[10:]
        text = "\n".join(m["content"] for m in old)
        async with gate:
            r = await client.chat.completions.create(
                model="uncensored",
                messages=[{"role": "user",
                           "content": "Update this story summary in under 150 words.\n"
                                      f"Previous summary: {self.summary}\n"
                                      f"New events:\n{text}"}],
                max_tokens=250,
            )
        self.summary = r.choices[0].message.content or self.summary

A few notes on the code. The semaphore is shared across all scenes, so it limits the whole bot, not each channel. The summary prompt is deliberately plain: you want a compact record of facts, names and open plot threads, not a rewrite of the prose. Trimming happens only after a reply, so the user never waits on the compression call. If your platform lets several members post at once, give each message the author's name, as the code does, so the model can tell speakers apart.

The persona string is where a character sheet goes: name, voice, background, how it speaks, what it will and will not do inside the story. The ground rules string is for your community's norms, such as keeping the story adult-only and fictional.

Memory without runaway cost

Models do not remember anything between calls, so every message resends the history. That is the main cost driver in roleplay, and the reason for the summary step above. Compare two bots, both on the same rates of $0.15 per 1M input tokens and $0.50 per 1M output tokens:

SetupTokens per replyCost per reply10,000 replies
Summary plus 16 recent messages3,000 in, 400 out$0.00065$6.50
Raw history, 20,000 tokens deep20,000 in, 400 out$0.0032$32.00

The math for the first row: 3,000 x $0.15 / 1,000,000 = $0.00045, plus 400 x $0.50 / 1,000,000 = $0.0002, which gives $0.00065. For the second row: $0.003 plus $0.0002 is $0.0032. The context window is 100,000 tokens, so the raw approach does work technically, but it costs nearly five times as much per reply. The compression call itself is small, about 2,500 tokens in and 250 out, or roughly $0.0005.

Serving many people at once

A full key allows 8 concurrent requests and 300 requests per minute. A busy server with several active scenes can exceed 8 if replies are generated in parallel. That is why the code uses a semaphore: extra requests wait in your process instead of failing. Without it you would get HTTP 429 with the code concurrency, and per-minute spikes return rate_limited. Overload can also return 429 with a Retry-After: 5 header, so wait and retry once.

A streamed reply holds its slot until it ends. If you stream so that text appears gradually in the channel, count each active stream against the 8. For very large communities, split scenes across more than one key rather than raising the semaphore. Parameter details are in the documentation.

Persona prompts that hold up

The persona prompt does most of the work in a roleplay bot, so it is worth writing carefully. A persona that works well in practice has a few parts:

  • Identity. Name, age (adult, stated plainly), role in the setting and a one-line temperament.
  • Voice. Two or three example lines of how the character talks, because the model imitates samples more reliably than adjectives.
  • Boundaries inside the fiction. What the character will not do or discuss, written as story facts rather than meta commands.
  • Format. Whether to use first person, how long replies should be, and whether actions go in asterisks.

Keep the persona short, around 300 to 500 tokens. It is resent with every call, so each extra 500 tokens costs 500 x $0.15 / 1,000,000 = $0.000075 per message, which adds up to $0.75 over 10,000 messages. Worth it for a persona that works, wasteful for padding. Test a persona by running the same ten opening messages with different temperatures and seeds, since seed is passed through and makes comparisons fairer.

Running a community responsibly

Having a model that does not refuse puts the moderation job on you. Some practical points:

  • Require adult membership and verify it in the way your platform allows.
  • Keep roleplay in clearly marked channels, with a rule that content stays fictional and consensual among participants.
  • Give players a way to stop or redirect a scene, such as an out-of-character command that resets the persona.
  • Log nothing you do not need. Prompts sent to the API are not used for training, but your own bot and your own logs are your responsibility.
  • Do not allow any sexual content involving minors. The model has a hard limit here, and your community must too.

Failed or refused requests are not charged, so a request that returns an error costs nothing.

Getting started and paying

Sign up with Google or with email and password, then claim the $0.50 trial credit with one click on the API key page. It is valid for 7 days and needs no payment details. At the 3,000-in, 400-out size, $0.50 covers roughly 769 replies (0.50 / 0.00065), enough for a real test with a few members. Trial keys are limited to 2 concurrent requests and 60 per minute, so keep the semaphore small while testing.

To keep running, top up with USDT on TRC20 or USDC on Base. Any whole amount from $20 to $500 works, with +5% credit from $50, +10% from $100 and +15% from $200. At $6.50 per 10,000 replies, $20 covers about 30,000 replies of that size. Credit does not expire. The pricing page has the full breakdown.

Questions and answers

Can this generate the images for my community?

No. It is a text API with no image, audio or video generation. It can write prompts or descriptions that you pass to a separate image tool.

Is there a content filter?

The model is tuned to answer without content refusals for lawful adult use. The one fixed limit is that sexual content involving minors is never allowed.

Does it work with SillyTavern or similar frontends?

Frontends that accept an OpenAI-compatible endpoint can use it. Enter the base URL https://api.uncensoredimage.cc/v1, your key and the model name uncensored.

How many users can one key serve?

A full key allows 8 concurrent requests and 300 per minute. How many people that supports depends on how often each one posts, so queue replies and measure.

Your key is one form away

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