Chat Completions API Documentation
Get started with the uncensored AI bot API by sending a single request to our OpenAI compatible endpoint. This guide covers authentication, streaming, and structured output for your coding and NSFW use cases.
- Base URL
https://api.uncensoredlocal.com/v1- Model
uncensored
Authentication and base URL
Connect by setting your API key and base URL in your client. The base URL is https://api.uncensoredlocal.com/v1. Every request requires the Authorization header with your key. No phone number is needed for signup, and you can authenticate via Google or email. Errors and refusals do not consume credit, so testing is free.
First request
Send a standard completion to generate text. Use the model ID uncensored for the model. The API accepts text input and returns text output. You can test the connection immediately after generating your key.
curl https://api.uncensoredlocal.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Find the current UTC timestamp."}]
}'
This returns the generated text in the response body. You can adjust parameters like temperature to control creativity. The model is tuned to answer without content refusals for lawful adult use.
Python SDK
Use the official OpenAI Python library to integrate quickly. Set the base URL to point to our service. Initialize the client with your API key and send a chat completion request.
from openai import OpenAI
client = OpenAI(base_url="https://api.uncensoredlocal.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)
The response object contains the generated content. You can access the text directly from the message object. This works with any standard OpenAI-compatible client library.
Node SDK
Install the OpenAI Node package to start building. Configure the base URL and API key in the client instance. Send a request to the chat completions endpoint.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.uncensoredlocal.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);
The result provides the full completion details. You can parse the text and use it in your application. The API supports all standard parameters for fine-tuning the output.
Streaming responses with SSE
Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE) as tokens are generated. This allows for real-time display of the output to the user.
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)
Each chunk contains partial text. The final chunk includes the token usage statistics. Streaming reduces the perceived latency for long responses. You can handle errors during the stream event by event.
Rate limits and quotas
Each API key is limited to 300 requests per minute. You can have 8 concurrent requests at the same time. The request body must not exceed 8 MB. If you send a request with an invalid key, you receive a 401 error. A 402 error indicates no credit. A 429 error means you hit the rate limit. The context window is 100,000 tokens for prompt and completion together. Max output is 16,000 tokens per request. Errors are free, so you can test limits without cost.
Common questions
What is the uncensored AI bot API base URL?
The base URL is HTTPS://api.uncensoredlocal.com/v1. It works with any OpenAI-compatible SDK by updating the base_url parameter. No other base URL is required for standard requests.
How do I get started with the uncensored LLM online?
Sign up with Google or email to get an API key instantly. Add crypto credit via USDT or USDC to start sending requests. The model ID is "uncensored" for all completions.
What are the rate limits for the uncensored local AI?
You are limited to 300 requests per minute and 8 concurrent requests per key. The context window is 100,000 tokens. Request bodies must be under 8 MB. Errors do not count against your rate limit.
Key generation in seconds
Register, retrieve your key, update the base URL. Done.
Base URLhttps://api.uncensoredlocal.com/v1