EN ▾
Claim trial key

OpenAI-compatible uncensored API

Claim trial key

https://api.uncensoredais.com/v1uncensored

API Documentation

Deploy your uncensored AI's workflow with a straightforward, OpenAI-compatible endpoint designed for developers who need raw text generation without content refusals. This guide covers the essential setup, request formats, and streaming capabilities for your uncensored LLM API integration.

Authentication and Base URL Setup

The uncensored LLM API requires a valid API key for every request. You generate this key instantly via Google login or email on the dashboard. Use the base URL https://api.uncensoredais.com/v1 for all interactions. This ensures compatibility with standard OpenAI SDKs. Your key authenticates your prepaid token balance. Errors and refusals do not consume credit. Keep your key secure. Rotate it if compromised. One active key per account simplifies management. The system replaces old keys automatically upon generation.

Sending Requests to /v1/chat/completions

Send your prompt to the POST /v1/chat/completions endpoint. Use the model identifier "uncensored" for inference. The context window supports 100,000 tokens for prompt and completion combined. You can generate up to 16,000 tokens per request. Set the max_tokens parameter to control output length. If omitted, the default is 2,048 tokens. The API accepts standard JSON bodies. Input text in, output text out. This simplicity reduces integration friction. Focus on your creative logic rather than complex routing. No embeddings or image generation are available here. Keep your requests under 8 MB. This limit ensures stable throughput for your NSFW API tasks.

Supported Parameters and JSON Mode

Control generation behavior with standard parameters. Use temperature for randomness. Adjust top_p for nucleus sampling. Set stop sequences to halt output at specific markers. Use seed for reproducible results. Enable JSON mode by setting response_format to {"type": "json_object"}. This ensures structured outputs for your applications. You can also configure presence_penalty and frequency_penalty to vary token diversity. Function calling is supported via tools and tool_choice. These features allow complex logic integration. The model handles tools efficiently. Test your parameters locally before production deployment. Fine-tuning is not currently offered. Stick to prompt engineering for customization.

Streaming Responses with SSE

Enable streaming by setting stream to true. The API returns Server-Sent Events (SSE). Each chunk contains partial text. The final chunk includes token usage statistics. This approach reduces perceived latency for users. It allows real-time display of generated text. Ideal for chat interfaces or live writing assistants. Parse the SSE stream in your client code. Handle the data: [DONE] signal to end the stream. This method works seamlessly with the official SDKs. You do not need to manage connections manually. The uncensored AI API handles the heavy lifting. Ensure your client handles stream interruptions gracefully. Token counts help monitor your prepaid balance accurately.

Handling Errors and Token Usage

Monitor HTTP status codes for API health. A 401 error indicates an invalid or expired API key. Re-authenticate via the dashboard to resolve this. A 402 error means your prepaid credit is exhausted. Top up via crypto to resume service. Errors and refusals do not consume tokens. A 429 error signals rate limiting. You are limited to 300 requests per minute per key. Concurrent requests are capped at 8 per key. The request body must not exceed 8 MB. Token usage is reported in the final response. Refusals are free. This economy model protects your budget. Check the Support page for refund adjustments on double charges. Credit never expires, so you can top up at your own pace.

Rate Limits and Model Details

The model "uncensored" is an open-weight model hosted on our servers. It is not GPT, Claude, or Gemini. It is tuned for lawful adult content without refusals. Minors in sexual content remain restricted. This hard limit applies always. The uncensored AI API provides a raw endpoint. No UI or routing is bundled. You pay only for what you use. Prepaid credit is charged by real token usage. No monthly fees exist. This structure suits high-volume creators. The 100,000 token context window allows long-form storytelling. Manage your concurrency to avoid 429 errors. Use the official SDKs for best compatibility. The uncensored LLM API is built for reliability. Integrate it into your fanfiction or creative writing workflow today.

cURL

curl https://api.uncensoredais.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "what is the capital of france"}]
  }'

Python

from openai import OpenAI

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

import OpenAI from "openai";

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

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

What is the base URL for the uncensored AI's API?

The base URL is HTTPS://api.uncensoredais.com/v1. It works with any OpenAI-compatible client by updating the base_url configuration. This ensures your existing code integrates easily.

How do I handle errors when using the uncensored LLM API?

Errors like 401 (invalid key) or 402 (no credit) are standard HTTP responses. Refusals and errors do not consume your prepaid tokens. Check your balance and key validity to resolve issues quickly.

Is the uncensored AI online service available for free?

No, it uses a prepaid token model. New accounts get $0.50 trial credit for 7 days. After that, you must top up with crypto. There are no monthly fees, only pay-per-use charges.

Get your key instantly

Register, retrieve your key, and update the endpoint. That is all.

Claim trial keyView documentation