tr ▾
Open account

Uncensored AI Chat API Docs

Get started with our uncensored LLM API in minutes. This guide covers authentication, sending requests, and handling streaming responses with zero guesswork.

Authentication & Base URL

Your API key authenticates every request. Use the base URL https://api.chatuncensor.com/v1 with any standard OpenAI-compatible SDK. Keep your key secure; one active key per account replaces the previous one.

  • Header: Authorization: Bearer YOUR_API_KEY
  • Base URL: https://api.chatuncensor.com/v1

Sending Your First Completion

Send a POST request to /v1/chat/completions with the model ID uncensored. This open-weight model returns text without content refusals for lawful adult use. You can set parameters like temperature or top_p to control randomness. The system supports JSON mode via response_format for structured outputs.

Ensure your payload includes the messages array. The model processes your input and returns the completion directly.

curl https://api.chatuncensor.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Send me the current UTC timestamp."}]
  }'

Python SDK Integration

Use the official OpenAI Python library to interact with our endpoint. Point the client to our base URL and provide your API key. This approach works seamlessly with existing codebases that already target OpenAI. You can adjust parameters like seed for reproducibility or stop sequences for control.

Initialize the client, send the completion, and handle the response. The SDK handles serialization and error parsing for you.

from openai import OpenAI

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

Integrate with Node.js using the openai package. Set the baseURL to our API endpoint. This allows you to use familiar methods like chat.completions.create(). You can pass tools for function calling or set temperature for creative variations.

Handle the response object to access the generated text. This method is ideal for server-side applications needing direct integration with our uncensored AI chat capabilities.

import OpenAI from "openai";

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

Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE) as tokens are generated. This provides a smoother user experience for chat interfaces. Token usage details appear in the final chunk.

Parse each event to update the UI in real time. This reduces perceived latency for long responses. You can stop streaming early if needed by aborting the request.

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)

Limits, Errors & Context

Our API enforces a 100,000 token context window per request. Max output is 16,000 tokens, or 2,048 if unspecified. You are limited to 300 requests per minute and 8 concurrent requests per key. Errors include 401 for invalid keys and 402 for insufficient credit.

Requests for sexual content involving minors are always refused. Errors and refusals do not consume your prepaid credit. Use the support page to resolve billing issues.

Questions and answers

How do I debug missing citations in parallel chat API responses?

Check the <code>usage</code> field in the final chunk of your streaming response. Parallel requests should be handled by your client code. Ensure you are not dropping chunks before the final one.

What happens if I exceed the rate limit?

You will receive a 429 status code. The limit is 300 requests per minute per key. Implement exponential backoff in your client. You can also request more keys if needed, but each account has one active key at a time.

Does the model forget previous conversations?

Yes, each request is independent unless you pass the conversation history in the <code>messages</code> array. The context window is 100,000 tokens total. You manage the history yourself to stay within this limit.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Open account