Uncensored AI API Quickstart
Get an uncensored roleplay AI instance running in minutes with our OpenAI-compatible API. Use standard SDKs to send text and receive long-context responses without content filters.
Prerequisites and base URL setup
Start by registering an account via Google or email on the key page. Your API key appears immediately and serves as the sole credential for all requests. The service base URL is https://api.uncensoredroleplayai.com/v1, which works with any OpenAI-compatible client.
Configure your environment variable or SDK client to point to this URL. This single endpoint handles all text completions. You do not need to manage model routing or select from multiple vendors. The model identifier is always uncensored, an open-weight model tuned for adult and fictional content.
Authentication with API keys
Include your API key in the Authorization header as a Bearer token. Every request must carry this header to authenticate your identity. If the key is missing or invalid, the server returns a 401 Unauthorized error. Check your account dashboard if you suspect the key was revoked.
Each account holds one active key at a time. Generating a new key replaces the old one immediately. There is no limit on the number of keys you can generate historically, but only the current one works. Use this single key across all your services.
Sending your first chat completion
Make a POST request to the /v1/chat/completions endpoint. Pass the model name uncensored and your conversation history in the messages array. The system returns a text response without filtering for lawful adult topics.
- Set the model to
uncensored. - Include your system prompt to define the roleplay persona.
- Submit user messages to drive the narrative forward.
Verify the response structure contains the generated text. This confirms your integration is working correctly with the uncensored LLM API.
Handling streaming responses
Enable streaming by setting stream to true in your request. The API sends chunks via Server-Sent Events (SSE). Each chunk contains partial text and metadata. Process these chunks in real-time to display the response as it generates.
Token usage details appear in the final chunk. This allows you to track costs accurately without waiting for the entire response. Streaming is ideal for roleplay bots where latency matters. Use the Node SDK for easy handling of these events.
Configuring parameters for roleplay
Adjust parameters like temperature and top_p to control creativity. Higher temperatures produce more diverse and unpredictable outputs. Use stop sequences to end responses at specific phrases. JSON mode is available via response_format for structured data.
Set max_tokens to control output length. The default is 2,048 tokens, but you can request up to 16,000. The context window supports 100,000 tokens total. This allows long-form continuity without losing context. Fine-tune these settings for your specific use case.
Understanding token usage and pricing
Pricing is transparent: $0.15 per million input tokens and $0.50 per million output tokens. Errors and refusals are free. Credit is prepaid and never expires. Top up via crypto with USDT (TRC20) or USDC (Base).
Limits include 300 requests per minute and 8 concurrent requests per key. The request body size is capped at 8 MB. If you run out of credit, you receive a 402 Payment Required error. Monitor your usage via the dashboard to avoid interruptions.
cURL
curl https://api.uncensoredroleplayai.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Summarize the main plot points of the provided story text"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.uncensoredroleplayai.com/v1", api_key="YOUR_KEY")
resp = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Summarise this thread without softening it."}],
)
print(resp.choices[0].message.content)Node.js
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.uncensoredroleplayai.com/v1", apiKey: process.env.API_KEY });
const resp = await client.chat.completions.create({
model: "uncensored",
messages: [{ role: "user", content: "Draft a villain monologue for my game." }],
});
console.log(resp.choices[0].message.content);Streaming
stream = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Tell the story in second person."}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)Technical Q&A
What is the uncensored roleplay AI context limit?
The context window supports 100,000 tokens for both prompt and completion. You can output up to 16,000 tokens per request. This allows for long-form storytelling without losing context. Refusals for minor sexual content still apply.
How do I handle authentication errors?
A 401 error indicates an invalid or missing API key. Check your account dashboard to ensure the key is active. Generate a new key if the old one was revoked. Each account holds one active key at a time.
What happens if I exceed the rate limit?
You will receive a 429 Too Many Requests error. The limit is 300 requests per minute and 8 concurrent requests. Wait a few seconds before retrying. Monitor your usage to stay within limits.
Retrieve your API key
Sign up, copy the token, update the endpoint. That is the entire configuration.