1. Uncensored AI Generator
  2. Uncensored AI Generator API Documentation

Uncensored AI Generator API Documentation

Get started with the uncensored ai generator API by authenticating with your API key and sending your first text completion request. This quickstart guide covers standard OpenAI-compatible integration patterns using curl, Python, and Node.js.

Base URL and Authentication

The API operates as a standard OpenAI-compatible endpoint. All requests must target the base URL https://api.uncensoredaigenerator.cc/v1 and include your unique API key in the Authorization header. You obtain this key immediately after signing up via Google or email on the Get API key page. Each account holds one active key; generating a new key invalidates the previous one. Ensure your client library is configured to point to this specific base URL rather than the default OpenAI endpoint.

First Request

Initiate a basic text completion by sending a POST request to /v1/chat/completions. The model identifier is uncensored. This endpoint accepts standard parameters like temperature and top_p. Below is a minimal example using curl to generate a response.

curl https://api.uncensoredaigenerator.cc/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
  }'

The response returns the generated text in choices[0].message.content. If you encounter a 401 error, verify your API key. A 402 error indicates insufficient prepaid credit, while 429 signals you have exceeded the 300 requests per minute limit.

Python SDK Integration

Use the official openai Python library to integrate the API into your backend pipelines. Initialize the client with the custom base URL and your API key. The SDK handles JSON serialization and streaming automatically. Configure the max_tokens parameter to control output length; the maximum output per request is 16,000 tokens, with a default of 2,048 if unspecified. The context window supports up to 64,000 tokens for the combined prompt and completion.

from openai import OpenAI

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

This approach ensures compatibility with existing codebases that already use OpenAI SDKs, requiring only a base URL change and model ID adjustment.

Node SDK Integration

For JavaScript environments, use the openai Node.js package. Set the baseURL to the API endpoint and provide your API key. The SDK supports both synchronous and asynchronous requests. You can pass an array of messages to the messages parameter, simulating a conversation history. This is useful for context-aware text generation or post-processing tasks.

import OpenAI from "openai";

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

Error handling should account for rate limits (429) and authentication issues (401). Ensure your Node.js version is compatible with the SDK version you install.

Streaming Responses

Enable streaming by setting stream: true in your request. The API returns a Server-Sent Events (SSE) stream, delivering tokens incrementally. This reduces perceived latency for long outputs. Token usage statistics are included in the final chunk of the stream. Streaming is ideal for real-time applications or when building user interfaces that display text as it is generated.

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)

Be prepared to handle partial content and ensure your client correctly processes the SSE format. The stream ends when the model completes the response or hits the token limit.

Limits, Errors, and Context Window

The API enforces strict limits: 300 requests per minute per key, 8 concurrent requests per key, and an 8 MB request body size. The context window is 64,000 tokens total. Errors include 401 for invalid keys, 402 for insufficient credit, and 429 for rate limits. Prepaid credit is charged by real token usage; errors and refusals are free. Credit never expires. The hard content limit blocks sexual content involving minors. Use these limits to design your retry logic and load balancing strategies.

Questions and answers

Does this API support image or video generation?

No. This is a text-only chat-completions API. It does not generate images, audio, video, or embeddings. It is designed for text pipelines, such as prompt writing, script generation, or post-processing.

How is pricing calculated?

Pricing is $0.25 per 1M input tokens and $1.00 per 1M output tokens. Credit is prepaid and charged by real token usage. Errors and refusals do not consume credit. Top-ups are available via crypto only.

Is the trial credit valid forever?

No. The $0.50 trial credit is valid for 7 days from account creation. Regular prepaid credit, however, never expires.

Your key is one form away

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