API Reference and Quickstart
This reference covers the uncensored AI open source API endpoint, authentication, and limits. Get a key, set your base URL, and start sending prompts immediately.
Base URL and Authentication
Use the provided base URL and your unique API key for every request. The uncensored AI API uses standard OpenAI-compatible headers. Send your key in the Authorization header as a Bearer token.
- Base URL:
https://api.uncensoredaiopensource.com/v1 - Model ID:
uncensored
Sign up with Google or email to get your key instantly. No phone number is required. Keep your key secure; it grants full access to your prepaid credit.
Chat Completions Endpoint
Send text prompts to the /v1/chat/completions endpoint. The uncensored LLM API accepts standard message arrays. You get direct access to one model without routing delays.
- Method:
POST - Content-Type:
application/json
Set the model to uncensored. The system ignores content filters for lawful adult use. Responses are returned in the choices array.
curl https://api.uncensoredaiopensource.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Generate a list of ten uncensored synonyms for lust"}]
}'
Python SDK Quickstart
Use the official OpenAI Python library. The uncensored AI API works with standard client configurations. Point the client to our base URL and provide your key.
- Install:
pip install openai - Set
base_urlto our endpoint
This approach lets you use existing code. You can stream responses or request JSON mode directly.
from openai import OpenAI
client = OpenAI(base_url="https://api.uncensoredaiopensource.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
Integrate with Node.js using the official SDK. The uncensored AI API supports standard JavaScript clients. Configure the base URL and key in your initialization.
- Install:
npm install openai - Set
basePathto our endpoint
Handle responses in JavaScript objects. This method is ideal for web apps or server-side rendering. You can control temperature and top-p parameters easily.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.uncensoredaiopensource.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 and Token Usage
Enable streaming by setting stream: true. The uncensored AI API returns data chunks via Server-Sent Events. Each chunk contains partial text. The final chunk includes token usage statistics.
- Set
stream: truein your request - Parse
delta.contentfor text
Token counts help you track costs. Input and output tokens are tallied per request. Errors during streaming do not charge your credit.
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)
Rate Limits and Constraints
Respect the API limits to avoid errors. The uncensored model supports a 100,000 token context window. You can send up to 300 requests per minute per key. Concurrency is limited to 8 simultaneous requests.
- Max request body: 8 MB
- Max output: 16,000 tokens
Exceeding limits returns a 429 error. Errors and refusals are free. Use retry logic with exponential backoff for rate limits.
Common questions
What is the uncensored AI open source model?
It is an open-weight LLM hosted on our servers. It does not refuse lawful adult, fictional, or controversial topics. It is not GPT, Claude, or any other vendor's model.
How do I handle 401 and 402 errors?
A 401 error means your API key is invalid or missing. A 402 error indicates your prepaid credit is exhausted. Top up via crypto to resume usage. Errors do not consume credit.
Does the uncensored AI API support function calling?
Yes, it supports function calling and JSON mode. Set <code>response_format</code> to <code>{"type": "json_object"}</code> for structured output. You can also use <code>tools</code> for dynamic function execution.
Generate your API key
Register, copy the key, and update your base URL. That’s it.