EN ▾
Get API key

AI Roleplay With Images: Text Engine Plus Image Tool

Free ai roleplay with images is always two systems glued together: a text model that plays the character, and an image model that draws what the text describes. This API is the first half only, and the trial credit lets you build and test that half without paying.

Updated

Chat bubbles linked by a light ribbon to an abstract picture frame, showing text and image stages of roleplay

Key points

  1. The API handles the story and the character voice. It does not generate images.
  2. Have the model emit a short scene description each turn, then pass it to the image tool you prefer.
  3. The $0.50 trial credit covers roughly 1,400 chat turns at a typical size, and needs no payment details.
  4. Roleplay is for lawful adult use only. Content involving minors is never produced.

How roleplay with images is put together

Apps that offer roleplay with pictures look like one product, but under the hood they run two models. One is a language model that reads the conversation and writes the next reply in character. The other is an image model that receives a prompt and returns a picture. Something in between decides when to draw, and writes the prompt from the story so far.

This service supplies the language model. You call it through an OpenAI-compatible API with the model ID uncensored, and it will continue a story without the content refusals that interrupt many hosted assistants, within lawful adult use. It is text only: no image generation, no audio, no video. If you want pictures, you attach a separate image tool and let this API write the prompts for it.

That split is not a limitation to work around. It is how most image-enabled roleplay setups are built, and it gives you two independent choices: which text model carries the personality, and which image model sets the visual style. You can change either one later without touching the other.

What free means here

Be careful with the word "free" in this niche. No hosted model costs nothing to run, so free offers are either limited, funded by ads or data, or a trial. Here the offer is a trial: after you sign up with Google or with email and password, you can claim $0.50 of credit with one click on the API key page. It is one per person, valid for 7 days, and needs no payment details.

After the trial, usage is pay as you go at $0.15 per 1M input tokens and $0.50 per 1M output tokens. There is no subscription. Credit does not expire, and refused or failed requests are not charged. Top-ups run from $20 to $500 in whole amounts, with a bonus of +5% from $50, +10% from $100 and +15% from $200. Payment is crypto only, in USDT on TRC20 or USDC on Base.

It also helps to know what the trial does not include. It does not raise the limits: a trial key is capped at 2 concurrent requests and 60 requests per minute. That is fine for one person, but if you run a Discord bot or serve several friends at once, a full key (8 concurrent requests, 300 per minute) is the sensible step once you have confirmed the writing quality suits you.

The image side has its own cost. If you run an image model on your own GPU, the price is electricity and time. If you use a hosted image service, check its current pricing, because this site cannot speak for it.

What $0.50 of trial credit buys

A roleplay turn is mostly input. Each request re-sends the character sheet and the earlier conversation, and the reply is comparatively short. Take a mid-sized chat: 1,500 input tokens (character setup plus recent history) and a reply of 250 output tokens.

  • Input: 1,500 × $0.15 / 1,000,000 = $0.000225
  • Output: 250 × $0.50 / 1,000,000 = $0.000125
  • One turn: $0.00035

Divide $0.50 by $0.00035 and you get about 1,428 turns, so call it 1,400. That is dozens of full sessions, enough to learn whether the writing style suits you. Two things change the number. Long histories raise the input side, and a model that writes long replies raises the output side, which costs more than three times as much per token. The cost analysis page works through further examples if you want to model your own usage.

A trial key allows 2 concurrent requests and 60 requests per minute, which is more than enough for one person chatting.

Step 1: a roleplay loop in Python

Start with text only. The loop below keeps a message list, sends it with each turn, and streams the reply so words appear as they are written. Install the SDK with pip install openai and set your key in the environment.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.uncensoredaiimage.top/v1",
    api_key=os.environ["UNCENSORED_API_KEY"],
)

CHARACTER = (
    "You are Mara, a dry-witted ship mechanic on a salvage vessel. "
    "Stay in character, write in the third person, 2 to 4 short paragraphs. "
    "All characters are adults."
)
history = [{"role": "system", "content": CHARACTER}]

while True:
    user = input("you> ")
    history.append({"role": "user", "content": user})
    stream = client.chat.completions.create(
        model="uncensored",
        messages=history,
        stream=True,
        temperature=0.9,
        top_p=0.95,
    )
    reply = ""
    for chunk in stream:
        if chunk.choices and chunk.choices[0].delta.content:
            piece = chunk.choices[0].delta.content
            reply += piece
            print(piece, end="", flush=True)
    print()
    history.append({"role": "assistant", "content": reply})

Streaming uses server-sent events. One thing to remember: a streamed request holds its concurrency slot until the stream finishes, so a client that drops the connection badly can leave a slot busy for a moment.

Step 2: have the story describe its own pictures

To get images, you need a prompt for the image model every time a scene changes. The reliable method is a second, cheap call that reads the latest reply and writes the prompt. It keeps the character voice clean, because the roleplay call never has to think about image syntax.

import json

APPEARANCE = "Mara: mid-30s, short dark hair, grease-stained overalls, silver wrench pendant."

def scene_prompt(last_reply: str) -> dict:
    resp = client.chat.completions.create(
        model="uncensored",
        messages=[
            {"role": "system", "content": (
                "Turn the passage into a text-to-image prompt. Return JSON with keys "
                "'prompt' (one paragraph: setting, lighting, pose, mood) and "
                "'negative_prompt'. Keep the character consistent with: " + APPEARANCE +
                " Keep it non-explicit and do not include text in the scene."
            )},
            {"role": "user", "content": last_reply},
        ],
        response_format={"type": "json_object"},
        max_tokens=400,
        temperature=0.7,
    )
    return json.loads(resp.choices[0].message.content)

The fixed APPEARANCE string is the trick that keeps a character looking similar from picture to picture. Image models have no memory between calls, so every prompt must restate the details that should stay constant: hair, clothing, a distinctive accessory. Pass the returned prompt to your image tool, whether that is a local diffusion setup or a hosted service. This site does not provide that part.

You do not have to draw after every turn. A simple rule works well: ask the model to include a flag, or trigger an image every fifth turn, or only when the user types a command such as /pic.

Alternative: let the model decide with tool calling

If you prefer the story model to choose when a picture is warranted, use tool calling. You declare a function, and the model returns a structured call to it when it thinks the moment deserves an illustration. Your code then runs the function and, if you like, sends the result back as a role: "tool" message.

tools = [{
    "type": "function",
    "function": {
        "name": "show_scene",
        "description": "Illustrate the current scene when the setting or mood changes.",
        "parameters": {
            "type": "object",
            "properties": {
                "prompt": {"type": "string", "description": "Image prompt, one paragraph"}
            },
            "required": ["prompt"],
        },
    },
}]

resp = client.chat.completions.create(
    model="uncensored",
    messages=history,
    tools=tools,
    tool_choice="auto",
)
msg = resp.choices[0].message
if msg.tool_calls:
    args = json.loads(msg.tool_calls[0].function.arguments)
    print("IMAGE PROMPT:", args["prompt"])

When you use tool calling in a loop, remember the full sequence. The model replies with a tool call, your code runs it, and you append a message with role: "tool" that holds the result, such as the path of the finished picture or a note that none was made. Then you call the API again so the model can continue the story with that result in view. If you skip that second call, the next user message arrives with a dangling tool call in the history and the model may behave oddly.

Tool calling is more elegant, though the two-call method above is easier to debug because each step has one job. Try both and keep whichever behaves better with your character.

Keeping long sessions healthy

The context window is 100,000 tokens for the prompt and reply together, which holds a long story. It still fills over weeks of chat, and cost grows with it because every turn re-sends the history. Two habits help. Keep a running summary: every 30 or 40 turns, ask the model to condense the older messages into a paragraph and replace them. And pin the character setup at the top, so a trimmed history never loses who the character is.

A last practical point concerns tone. The image prompt writer should be told to keep scenes suitable for the image tool you use, because many image services apply their own rules, separate from this API. If a picture request is rejected there, the story model is not at fault. Adjust the scene description, choose a backend whose rules suit your project, or run an image model on your own hardware. The two halves have independent policies, and keeping them apart makes it easier to see which one caused a failure.

For setup details beyond what is here, the documentation shows the same calls in curl and Node. For top-ups after the trial, see the pricing page.

One rule is fixed: no sexual content involving minors, in any framing. State in your character sheet that all characters are adults, as the example does. The service is intended for fiction and companion-style apps for lawful adult use.

Questions and answers

Is there a completely free way to do this?

The $0.50 trial credit is free and needs no payment details, but it is a trial. After it is used, the API is pay as you go from prepaid credit.

Does this API create the pictures?

No. It writes the story and the image prompts. You need a separate image model or service to turn those prompts into pictures.

Can I use this with a roleplay front end?

Any client that lets you set a custom OpenAI-compatible endpoint can use it. Enter the base URL https://api.uncensoredaiimage.top/v1, your key and the model ID uncensored.

How do I keep the character looking the same in every image?

Restate a fixed appearance description in every image prompt. Image models do not remember earlier pictures, so consistency has to come from the prompt.

Your key is one form away

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