Uncensored AI API Documentation
Start generating text with our uncensored LLM API in seconds. This guide covers authentication, endpoints, and streaming for immediate integration.
Authentication and Base URL
Use your API key with every request to access the uncensored AI service.
Set the base URL to https://api.bestuncensoredmodels.com/v1 and pass your key in the Authorization header. You receive one key per account, and it appears immediately after signup.
First Request
Send a standard completion to receive raw, unfiltered text output.
The model ID is uncensored. Configure your client to point to our base URL and include your credentials.
curl https://api.bestuncensoredmodels.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Show me the list of models supporting 4k context windows"}]
}'
Python SDK Integration
Initialize the client with your key and the correct base URL to enable the uncensored LLM API.
Install the official OpenAI package and configure the host. This allows you to use familiar methods while accessing our dedicated infrastructure.
from openai import OpenAI
client = OpenAI(base_url="https://api.bestuncensoredmodels.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
Configure the Node.js client to route requests to our uncensored models endpoint.
Set the baseURL and apiKey properties. This ensures your application communicates directly with our servers without proxy overhead.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.bestuncensoredmodels.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
Enable streaming to receive tokens in real-time via Server-Sent Events.
Set stream to true in your request. The final chunk contains the total token usage for billing transparency. This reduces perceived latency for long-form creative writing.
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)
Limits, Errors, and Context
Your requests are subject to a 100,000-token context window and a 300 requests-per-minute limit.
Handle 401 errors by verifying your key. A 402 error indicates insufficient prepaid credit. Use 429 to manage rate limits. Errors do not consume credit, ensuring you only pay for successful tokens.
Frequently asked questions
What is the context window size for the uncensored AI API?
The context window is 100,000 tokens, covering both the prompt and the completion. This allows for extensive conversations or large document processing without immediate truncation.
How do I handle rate limits on the uncensored LLM API?
The limit is 300 requests per minute per key. If you exceed this, the API returns a 429 status code. Implement exponential backoff in your client to resume requests smoothly.
Does the uncensored AI service charge for failed requests?
No. Errors such as 401, 402, or 429 do not consume your prepaid credit. You only pay for tokens generated in successful responses, making it cost-effective for testing.
Obtain your API key now
Register, retrieve your key, and point your base URL. Complete setup in seconds.
Open account