EN ▾
Try with trial credit

API Reference & Quickstart

Start sending requests to our uncensored LLM API immediately using standard OpenAI-compatible endpoints. This guide covers authentication, basic requests, and streaming with concrete limits.

Try with trial credit

Authentication and Base URL

Use your API key with the base URL https://api.chatuncensored.cc/v1. Pass the key in the Authorization header as a Bearer token. This setup works with any OpenAI-compatible SDK or client.

Generate your key on the dashboard via Google or email. Keep it secure. You receive $0.50 valid for 7 days. Use this to test connectivity before topping up with crypto.

POST /v1/chat/completions

Send text to the model using the chat-completions endpoint. Specify the model ID as uncensored. This open-weight model responds without refusals for lawful adult content.

Include your system prompt to guide behavior. Set the user message with your query. The API returns text output directly.

Configure parameters like temperature or top_p for varied results. The model handles context up to 100,000 tokens combined.

Errors like refusals or network issues do not consume credit. You only pay for successful token generation.

Python SDK Usage

Install the official OpenAI Python library. Configure the base URL to point to our API. Set the API key in the environment or client.

Create a client instance. Call chat.completions.create with the model and messages. Retrieve the assistant's reply from the response object.

Handle exceptions for rate limits or invalid keys. The SDK simplifies JSON parsing and request formatting.

Test with the trial credit first. Verify the response structure matches expectations before scaling usage.

Node SDK Integration

Import the OpenAI Node package. Initialize the client with your base URL and key. Define the model as uncensored.

Call the completions method with your message array. Await the response to get the generated text. This works seamlessly with async functions.

Use JSON mode by setting response_format to {"type": "json_object"}. Ensure your output is valid JSON for programmatic use.

Monitor usage via the response tokens. Track input and output counts to manage your prepaid credit efficiently.

Streaming, Tools, and JSON Mode

Enable streaming by setting stream to true. Receive chunks via Server-Sent Events. Process each token as it arrives for low latency.

Supports function calling with tools and tool_choice. Define schemas for external APIs. The model returns structured arguments for execution.

Use JSON mode for strict output formats. Set response_format to ensure valid JSON responses. This reduces parsing errors in automated pipelines.

Combine streaming with tools for interactive experiences. Update the UI token by token. Keep users engaged with real-time generation.

Rate Limits and Error Codes

Expect 300 requests per minute per key. Limit concurrent requests to 8. Request body size must stay under 8 MB.

Handle 401 errors by verifying your API key. Check for typos or expired keys. Regenerate if necessary.

Receive 402 when credit runs out. Top up with USDT or USDC. Credits never expire. Add +15% bonus on $200 deposits.

Face 429 on rate limits. Implement exponential backoff. Retry after the specified delay. Monitor usage to avoid disruption.

cURL

curl https://api.chatuncensored.cc/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Set user role to beta tester for the new chat interface"}]
  }'

Python

from openai import OpenAI

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

FAQ

Is the chat uncensored API compatible with OpenAI clients?

Yes, it uses the standard OpenAI-compatible endpoint structure. You can use any SDK or client that supports the chat-completions format. Just update the base URL and API key.

What happens if I exceed the rate limit?

You will receive a 429 error code. Requests stop until the window resets or you reduce your concurrency. Keep concurrent requests under 8 and stay within 300 RPM.

How does the uncensored model handle context windows?

It supports a 100,000-token context window for both prompt and completion. Max output per request is 16,000 tokens. Adjust max_tokens if you need shorter responses.

Start with trial credit

Enter email and password; receive key instantly.

Try with trial credit