Quickstart: uncensored model API
Start generating unrestricted text with our uncensored model API in minutes using standard OpenAI-compatible endpoints. This guide covers authentication, basic requests, streaming, and parameter configuration.
Prerequisites and Base URL
Our API works with any standard OpenAI-compatible client by updating the base URL and API key. Point your SDK to https://api.modeluncensored.com/v1 and send requests to the standard /v1/chat/completions endpoint. You do not need to install proprietary libraries; existing tools like the official OpenAI Python or Node.js SDKs work immediately. Simply configure the base URL to route traffic through our servers instead of the default OpenAI infrastructure.
Authentication relies on a single API key generated during signup. Pass this key in the Authorization header as a Bearer token. The model identifier is fixed at uncensored to ensure consistent behavior across all requests. Each account provides one active key that replaces any previous key upon regeneration.
Authentication With Your API Key
Include your API key in the Authorization header of every request to verify your identity. Use the format Authorization: Bearer YOUR_API_KEY to authenticate requests instantly. If the key is missing or invalid, the API returns a 401 Unauthorized error immediately. This ensures that only valid accounts can consume tokens from your prepaid credit.
You can generate or regenerate your key via the dashboard after signing in with Google or email. The key is displayed immediately upon creation. Store it securely, as it provides direct access to your account balance. There is no phone number verification required for signup, keeping the process fast and simple.
Sending Your First Chat Completion
Make a POST request to /v1/chat/completions with your messages and the model identifier to receive a response. The model accepts text input and returns text output without soft refusals for lawful adult content. You can specify the model ID as uncensored to ensure you are using our specific uncensored LLM. This endpoint supports both synchronous and streaming responses for flexibility.
Requests are charged based on actual token usage. Errors and refusals do not consume credit, so you can test freely. The maximum output per request is 16,000 tokens, or 2,048 tokens if you do not set the max_tokens parameter. The context window supports up to 100,000 tokens for prompt and completion combined.
Handling Streaming Responses (SSE)
Enable streaming by setting stream: true in your request to receive tokens as they are generated. This reduces perceived latency for long responses and allows real-time display in your application. The final chunk of the stream contains the total token usage statistics for billing and monitoring. This is essential for building chat interfaces that feel responsive and interactive.
Stream responses handle partial content gracefully, allowing you to display text as it arrives. This is particularly useful for creative writing or coding tasks where the model generates long outputs. You can parse the server-sent events to update your UI incrementally. Ensure your client handles the end-of-stream event correctly to finalize the response.
Configuring Parameters: Temperature, Top-p, and Seed
Adjust temperature to control randomness, with higher values producing more creative and varied outputs. Use top_p to limit sampling to the most probable tokens, providing finer control over the output distribution. Setting a seed ensures deterministic results, which is crucial for debugging or reproducible experiments. These parameters allow you to tune the model's behavior for specific use cases like storytelling or technical writing.
The model supports standard parameters like stop sequences and presence_penalty for advanced control. You can combine these settings to achieve the desired tone and structure. Experiment with different values to find the optimal balance between creativity and coherence for your application.
Using Tools and JSON Mode
Enable function calling by providing a tools array in your request to let the model output structured data. The model can invoke functions based on the context of the conversation, enabling complex workflows. Use response_format: {"type": "json_object"} to force the output into valid JSON format. This is ideal for integrating with backend systems or extracting structured information from text.
JSON mode ensures the response is parseable, reducing the need for additional parsing logic in your client. You can define multiple tools and specify which tool the model should call. This feature enhances the model's utility for automated tasks and data extraction. The API handles the routing of tool calls seamlessly.
cURL
curl https://api.modeluncensored.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Return the current system time in ISO format"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.modeluncensored.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.js
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.modeluncensored.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
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)FAQ
What is the uncensored model API?
It is a hosted, OpenAI-compatible API serving a single uncensored large language model. You get text input and output via standard endpoints without content refusals for lawful adult topics. It eliminates the complexity of proxy routers and soft censorship found in mainstream providers.
How do I handle rate limits and errors?
The API enforces a limit of 300 requests per minute and 8 concurrent requests per key. A 401 error indicates an invalid key, while a 402 error means you have insufficient credit. A 429 error signals that you have exceeded the rate limit. Errors do not consume your token balance.
What is the context window and output limit?
The context window supports up to 100,000 tokens for both prompt and completion combined. The maximum output per request is 16,000 tokens. If you do not set the max_tokens parameter, the default output is limited to 2,048 tokens. This allows for long-form content generation and detailed analysis.
Get your API key
Sign up, copy your key, update the base URL. Done.
Create key