EN ▾

Uncensord ai API Documentation

Start generating text with our uncensored LLM API in minutes. This guide covers authentication, endpoints, and integration for standard OpenAI-compatible clients.

https://api.uncensordai.com/v1uncensored

API Base URL and Authentication

Connect using the standard OpenAI base URL with your API key. We use a single bearer token for all requests, ensuring compatibility with existing SDKs.

Your key is issued immediately upon signup. Keep it secure.

  • Base URL: https://api.uncensordai.com/v1
  • Authentication: Bearer token in the Authorization header
curl https://api.uncensordai.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "What is the current version of python"}]
  }'

Chat Completions Endpoint

Send messages to the /v1/chat/completions endpoint. The model ID is uncensored.

Requests return text responses. Context window is 100,000 tokens. Max output is 16,000 tokens.

from openai import OpenAI

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

SDK Integration Examples

Use the official OpenAI SDK or any compatible client. Set the base URL and API key.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.uncensordai.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 is supported via Server-Sent Events (SSE).

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)

Streaming Responses and Token Usage

Enable streaming by setting stream: true. Token usage appears in the final chunk.

Each chunk contains partial text. Aggregate them for the full response.

Parameters: Temperature, Top P, and Stop

Control generation with standard parameters. Use temperature for randomness.

Set top_p for nucleus sampling. Define stop sequences to halt generation. JSON mode uses response_format: {"type": "json_object"}.

Error Handling and Rate Limits

Handle errors gracefully. Code 401 means invalid key. Code 402 indicates no credit. Code 429 signals rate limit exceeded.

Limit is 300 requests per minute. Context window is 100,000 tokens. Errors are free.

FAQ

What is the uncensord AI context window?

The context window is 100,000 tokens for prompt and completion combined. Max output per request is 16,000 tokens.

How do I authenticate with the uncensored AI API?

Include your API key in the Authorization header as a Bearer token. Use the base URL provided in the documentation.

Does the uncensord AI API support streaming?

Yes, streaming is supported via Server-Sent Events. Token usage is reported in the final chunk.

Get your API key

Register, copy the key, update the base URL. Setup is done.

Open account