ru ▾
Start now

API Documentation

Get your uncensored API key and start sending requests immediately. This guide covers the endpoints, parameters, and limits you need to integrate our OpenAI-compatible chat model into your project.

Base URL and Authentication

The base URL for all requests is https://api.apiuncensored.com/v1. Authenticate by passing your unique API key in the Authorization header. Each account holds one active key; issuing a new one invalidates the previous key instantly. Keep this key secure, as it grants full access to your prepaid credit.

Chat Completions Endpoint

Send text to the model via POST /v1/chat/completions. The model ID is uncensored. This endpoint handles standard prompt-completion interactions without returning embeddings or images. You can adjust temperature, top_p, and stop sequences to control creativity and output length. The model refuses only sexual content involving minors, allowing unrestricted handling of adult, controversial, or security-research topics.

curl https://api.apiuncensored.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Get the current server status code for the production environment"}]
  }'

Streaming and Tokens

Enable streaming by setting stream: true in your request body. The API returns Server-Sent Events (SSE) chunks, allowing real-time display of generated text. Token usage statistics appear in the final chunk of the stream. This approach reduces perceived latency for long responses. Note that the context window supports up to 100,000 tokens combined for prompt and completion.

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)

Tools and Function Calling

Integrate external tools by providing a tools array in your request. The model can return structured tool calls instead of plain text. Use tool_choice to force specific function invocations. This feature works seamlessly with the standard OpenAI SDKs. Define your function schemas clearly to ensure accurate parsing of the model's output. The API supports dynamic tool execution for complex workflows.

from openai import OpenAI

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

JSON Mode

For strict data structures, set response_format to {"type": "json_object"}. The model will output valid JSON without extra markdown wrapping. This ensures reliable parsing in your application logic. Use this mode when building APIs or data pipelines that require consistent formatting. It eliminates the need for post-processing regex patterns to extract data.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.apiuncensored.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);

Limits, Errors, and Context

Each key allows 300 requests per minute and 8 concurrent requests. The maximum request body size is 8 MB. If the key is invalid, you receive a 401 error. A 402 error indicates insufficient prepaid credit; top up via crypto to resume. A 429 error means you have exceeded the rate limit. The model supports a 100,000-token context window, but max output is 16,000 tokens per request.

Common questions

Does the uncensored API support function calling?

Yes. You can define tools in your request and use <code>tool_choice</code> to control invocation. The API returns structured tool calls compatible with standard SDKs.

What happens if I exceed the rate limit?

The API returns a 429 status code. You can make up to 300 requests per minute per key with 8 concurrent requests allowed.

How large is the context window?

The context window is 100,000 tokens for both prompt and completion combined. However, the maximum output per request is 16,000 tokens.

Get your key instantly

Sign up, copy the key, update the base URL. That is all.

Start nowView documentation