sv ▾

Developer Documentation for Uncensored AI API

Get started with the uncensored LLM API in minutes. Send text, get text, and handle adult themes without policy flips.

Base URL
https://api.localuncensoredai.com/v1
Model
uncensored

Start with free credits

Use email and password to see your key immediately.

Create key

Base URL and Authentication

Use the provided base URL and a single API key for every request. The endpoint lives at https://api.localuncensoredai.com/v1 and follows standard OpenAI-compatible patterns. You create an account via Google or email, then receive your key immediately on the dashboard. No phone number is required, and you can start testing right away.

  • Base URL: https://api.localuncensoredai.com/v1
  • Authentication: Authorization: Bearer YOUR_API_KEY
  • Model ID: uncensored
curl https://api.localuncensoredai.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Set timezone to UTC and enable logging"}]
  }'

First Request with Python

Initialize the client with your key and base URL, then call the chat completions endpoint. This approach works with the official OpenAI SDKs because the interface matches exactly. You send a user message and receive a direct text response from the uncensored model. Errors like missing credit return a 402, while invalid keys trigger a 401.

from openai import OpenAI

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

Import the OpenAI-compatible package and configure the base URL to point to our servers. Set the model ID to uncensored and pass your messages array. This method keeps your code clean and leverages existing ecosystem tools. You can adjust parameters like temperature or top_p directly in the request body.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.localuncensoredai.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 Responses via SSE

Enable streaming by setting stream: true in your request. The API returns server-sent events, allowing you to process tokens as they generate. This is crucial for building chat interfaces that feel responsive. The final chunk includes the total token usage for accurate billing.

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)

Function Calling and JSON Mode

Define tools in your request to enable function calling capabilities. You can also force JSON output using response_format: {"type": "json_object"}. This ensures structured data for your applications without extra parsing. The model handles tool execution instructions consistently for uncensored content.

Rate Limits, Errors, and Context

Your key allows 300 requests per minute with up to 8 concurrent connections. The context window supports 100,000 tokens total, with a max output of 16,000 tokens. Errors include 401 for invalid keys, 402 for insufficient credit, and 429 for rate limits. Requests that error out or refuse due to policy do not consume credit.

Common questions

How do I get my API key?

Sign up using Google or your email on the dashboard. Your API key is displayed immediately after registration, allowing you to start making requests without delay. No phone number or payment method is required for the initial setup.

What is the context window size?

The model supports a 100,000-token context window, combining both prompt and completion tokens. You can generate up to 16,000 tokens in a single response. If you do not specify <code>max_tokens</code>, the output defaults to 2,048 tokens.

Does the API support function calling?

Yes, the API supports function calling and tool use. You can also enforce JSON output mode for structured responses. This allows you to integrate the model into complex applications that require specific data formats or external tool execution.

Get your key instantly

Sign up, copy the key, update your base URL. That’s it.

Create keyRates