API Documentation & Quickstart
Integrate the uncensored al API into your project with zero configuration. This guide provides the base URL, authentication steps, and code samples to get your first request running immediately.
Base URL and Authentication
Start by setting your base URL to HTTPS://api.uncensoredal.com/v1 and passing your API key in the Authorization header. You receive one active key per account, and generating a new key instantly invalidates the previous one. This simple setup works with any standard OpenAI-compatible client without complex routing logic.
curl https://api.uncensoredal.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Generate the next 50 lines of a python script"}]
}'The endpoint is strictly for chat completions, so you do not need to manage model routing. Every request must include the model identifier "uncensored" to ensure you are hitting the correct inference server. Authentication failures return a 401 status if the key is missing or invalid.
Chat Completions Endpoint
Send a POST request to /v1/chat/completions with your message history in the messages array. The system processes text input and returns generated text without content refusals for lawful adult use. You must specify the model as "uncensored" in your payload to ensure compatibility.
from openai import OpenAI
client = OpenAI(base_url="https://api.uncensoredal.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)Requests are charged based on actual token usage, with errors and refusals remaining free. This prepaid model means you only pay for what you consume. The endpoint supports standard parameters like temperature and top_p for controlling output randomness.
Streaming Responses with SSE
Enable streaming by setting stream to true in your request body to receive tokens via Server-Sent Events. Each chunk includes token usage statistics in the final chunk, allowing you to track costs in real time. This approach reduces perceived latency for long generations.
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)Use streaming when building chat interfaces that need to display text as it generates. The API returns standard OpenAI-compatible stream events, making it easy to integrate with existing UI libraries. You can stop the stream early if the user changes their input.
Function Calling and JSON Mode
Define tools in your request to enable function calling or force JSON output using response_format. The API supports tool_choice for precise control over when the model should invoke a function. This feature works with the standard OpenAI schema, so you can reuse existing tool definitions.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.uncensoredal.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);JSON mode ensures the output is valid JSON, which is useful for parsing structured data programmatically. You can combine this with temperature settings to balance creativity with structural reliability. The API handles tool execution logic by returning the function call details for your code to process.
Model Parameters Configuration
Configure parameters like temperature, top_p, stop sequences, and seed to control generation behavior. The context window supports 100,000 tokens for both prompt and completion combined. Max output is capped at 16,000 tokens per request, or 2,048 if you do not specify max_tokens.
You can use presence_penalty and frequency_penalty to reduce repetition in longer texts. These parameters allow fine-tuning of the model's style without changing the underlying weights. Adjust them incrementally to find the right balance for your specific use case.
Limits, Errors, and Context
Rate limits are set to 300 requests per minute and 8 concurrent requests per key. Request bodies are capped at 8 MB, so large context windows must be managed carefully. Errors include 401 for invalid keys, 402 for insufficient credit, and 429 for rate limits.
Credit never expires, so you can pause usage between bursts without losing funds. If you hit the concurrent limit, retry with exponential backoff. The 100,000 token context window allows for extensive history, but keep an eye on output limits to avoid truncation.
Frequently asked questions
How do I get started with uncensored al?
Create an account using Google or email, then generate your API key. Use the base URL HTTPS://api.uncensoredal.com/v1 with your key in the Authorization header to send your first request. New accounts receive $0.50 in trial credit valid for 7 days.
What is the context window size?
The API supports a 100,000 token context window, which includes both the prompt and the completion. Max output is limited to 16,000 tokens per request, or 2,048 tokens if you do not specify max_tokens.
Can I use standard OpenAI SDKs?
Yes, the API is fully OpenAI-compatible. You can use the official OpenAI SDKs for Python, Node.js, and other languages by simply changing the base URL and providing your API key. The model identifier is "uncensored".
Retrieve your API key
Register, copy your key, and update the base URL. That is all that is required.