cs ▾
Get API key

Uncensored Models API Quickstart

Start building with our uncensored LLM API in minutes using standard OpenAI SDKs. Get your key, configure your base URL, and send text requests immediately.

Install the Official OpenAI SDK

Install the official SDK to access our uncensored API using familiar tools. This library handles authentication, retries, and JSON parsing automatically. You do not need a separate client for our service.

Run the standard installation command for your environment. The package works with Python 3.8+ and Node.js.

Python

  • pip install openai

Node.js

  • npm install openai

These libraries are the standard way to interact with OpenAI-compatible endpoints. Our API follows the same structure.

Configure Your Base URL and Key

Set your base URL and API key to route requests to our servers. Your key authenticates your account and tracks token usage.

Use the base URL provided in your dashboard. Replace YOUR_API_KEY with the string generated after signup.

Environment Variables

  • OPENAI_API_KEY=sk-...
  • OPENAI_BASE_URL=HTTPS://api.uncensoredmodels.cc/v1

This configuration ensures your requests reach the correct uncensored model. The SDK uses these values for all subsequent calls.

Send Your First Chat Completion

Send a chat completion request to receive text output from the model. The endpoint accepts standard message structures.

Use the model ID uncensored for the best results. This model is tuned to answer without refusals for lawful adult content.

Set the max_tokens parameter to control output length. The default is 2,048 tokens if you do not specify a limit.

Enable Streaming for Real-Time Tokens

Enable streaming to receive tokens as they are generated. This provides a smoother user experience for chat interfaces.

Set stream=true in your request. The API returns Server-Sent Events (SSE) with each token.

Parse the stream to display text incrementally. This reduces perceived latency for end-users. The final chunk contains total token usage.

Use Tools and JSON Mode

Use tools for function calling or JSON mode for structured data. These features work exactly like the OpenAI API.

Define your tool schema or request JSON format. The model will follow your structure constraints.

Set response_format to json_object for strict JSON output. This ensures consistent parsing in your application logic.

Handle Limits and Errors

Handle rate limits and errors to keep your application stable. The API enforces specific constraints per key.

Expect 429 errors if you exceed 300 requests per minute. You can make 8 concurrent requests at once.

Check for 401 errors if your key is invalid. 402 errors indicate insufficient credit. Each request body must be under 8 MB.

cURL

curl https://api.uncensoredmodels.cc/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Generate a test message confirming connection to the API endpoint"}]
  }'

Python

from openai import OpenAI

client = OpenAI(base_url="https://api.uncensoredmodels.cc/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.uncensoredmodels.cc/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)

Frequently asked questions

How much context window does the uncensored API support?

The model supports a 100,000 token context window. This includes both the prompt and the completion tokens combined. Use this for long documents or extensive conversation history.

What happens if I get a 429 error?

A 429 error means you have exceeded the rate limit of 300 requests per minute. Wait a short period before retrying your request. You can also reduce concurrent requests to 8 per key.

Is this API compatible with OpenAI SDKs?

Yes, it is fully OpenAI-compatible. You can use the official SDKs by changing the base URL to HTTPS://api.uncensoredmodels.cc/v1. The model ID is <code>uncensored</code>.

Access your key in one step

Register, retrieve your key, and update the base URL. That’s all.