Unrestricted Character AI API Documentation
Deploy the uncensored LLM API in minutes using standard OpenAI SDKs. Get your key, set the base URL, and send text without content filters.
Base URL and Authentication
The API key authenticates your requests. Use Continue with Google or email signup to generate one instantly. Set the base URL to https://api.unrestrictedcharacterai.com/v1 in your client configuration. This works with any OpenAI-compatible SDK.
curl https://api.unrestrictedcharacterai.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Set the temperature to 0.7 for stable replies."}]
}'
Chat Completions Endpoint
Send messages to POST /v1/chat/completions. The model ID is uncensored. It responds to lawful adult, fictional, or controversial topics without refusal. Text in, text out. No extra services clutter the request.
from openai import OpenAI
client = OpenAI(base_url="https://api.unrestrictedcharacterai.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 SDK Integration
Use the official Node SDK for seamless integration. Pass the base URL and key. The client handles the HTTP layer. You receive structured JSON responses. Error handling is standard. Check the status code.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.unrestrictedcharacterai.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 Responses and SSE
Enable streaming by setting stream: true. You receive Server-Sent Events (SSE). Token usage appears in the last chunk. This reduces perceived latency for long outputs. The model generates text token by token.
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)
JSON Mode and Function Calling
Use response_format: {"type": "json_object"} for strict JSON. Function calling supports tools and tool_choice. Define schemas in your messages. The model adheres to the structure. Parse the output programmatically.
Limits and Errors
Rate limit is 300 requests per minute. Context window is 100,000 tokens. Error 401 means invalid key. Error 402 means no credit. Error 429 means rate limit exceeded. Max request body is 8 MB. Use these codes to debug quickly.
Common questions
Is the unrestricted character AI API openai compatible?
Yes. It uses the same endpoints and SDKs as OpenAI. Change the base URL and API key. Your existing code works with zero changes.
What is the context window size?
The context window is 100,000 tokens. This includes both prompt and completion. You can send long documents or chat histories.
How do I handle errors?
Use standard HTTP status codes. 401 indicates authentication failure. 402 indicates insufficient credit. 429 indicates rate limiting. Check the response body for details.