Base URL and Authentication
The uncensored LLM API uses a single base URL: https://api.chatbotsaiuncensored.com/v1. You authenticate by passing your API key in the Authorization header as a bearer token. Generate your key on the dashboard via Google or email; it appears immediately. Use the key in every request to access the uncensored model without hidden limits or subscriptions.
curl https://api.chatbotsaiuncensored.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "List 5 Linux commands to check disk usage"}]
}'
Sending your first chat completion
Send a POST request to /v1/chat/completions with a simple message array. The model ID is uncensored. This returns a direct text response suitable for roleplay or creative writing. You can adjust parameters like temperature to control creativity. The uncensored AI models handle diverse topics without standard refusals for lawful adult content.
from openai import OpenAI
client = OpenAI(base_url="https://api.chatbotsaiuncensored.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)
Streaming responses via SSE
For real-time generation, set stream: true. The API returns Server-Sent Events (SSE) as tokens become available. This reduces perceived latency for long outputs. You can process each chunk individually or aggregate them. Streaming works seamlessly with the uncensored AI API for dynamic chat experiences.
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)
Function calling and JSON mode
Use the tools parameter for function calling or set response_format to json_object. This ensures structured output for programmatic use. The uncensored LLM adheres to JSON schemas reliably. You can define custom functions or enforce strict JSON modes. This flexibility supports complex workflows without external parsing hacks.
Parameters: temperature, top_p, and seed
Control generation style with temperature (0-2), top_p, and stop sequences. Set seed for reproducible results. Higher temperatures increase randomness; lower values make outputs more deterministic. These parameters apply to all uncensored AI models hosted here. Adjust them to fit your specific NSFW chatbot or data generation needs.
Rate limits and error handling
Limit: 300 requests/minute, 8 concurrent requests, 8MB body. Errors include 401 (invalid key), 402 (no credit), and 429 (rate limit). Handle retries with exponential backoff. The context window is 100,000 tokens total. Errors do not consume credit. Monitor limits to ensure smooth uncensored LLM API operation in production environments.
Node.js
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.chatbotsaiuncensored.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);