Get API key
per 1M input tokens
$0.25
Output tokens / 1M
$1.00
token context
64,000
trial credit
$0.50
requests per minute
300

Unrestricted AI API Documentation

Get started with the Unrestricted AI API by authenticating with your key and sending requests to our OpenAI-compatible endpoint. This quickstart covers the essential endpoints, streaming, and configuration for uncensored text generation.

Base URL and Authentication

Start by setting your base_url to https://api.unrestrictedai.top/v1. We use standard OpenAI-compatible headers. Add your API key to the Authorization header as a Bearer token. You can generate a key via the "Get API key" page using Google or email. Each account holds one active key; issuing a new one revokes the previous. The trial credit is $0.50, valid for 7 days, requiring no card.

Your First Request

Send a POST request to /v1/chat/completions with the model ID "uncensored". The API returns text completions based on your prompt. Errors and refusals do not consume your prepaid credit. You can test connectivity immediately after signing up.

curl https://api.unrestrictedai.top/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."}]
  }'

Python SDK Integration

Use the official openai Python package. Configure the client with the correct base URL and your API key. The model name is always "uncensored". This approach allows you to integrate the API into your Python scripts or backend services efficiently without extra wrappers.

from openai import OpenAI

client = OpenAI(base_url="https://api.unrestrictedai.top/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 SDK Integration

Initialize the OpenAI client in Node.js with the specific base URL. Set the model to "uncensored". This setup works with standard OpenAI-compatible clients, making it easy to add uncensored generation to your JavaScript or TypeScript applications.

import OpenAI from "openai";

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

Enable streaming by setting stream: true. The API returns Server-Sent Events (SSE). Token usage data appears only in the final chunk. This is ideal for real-time UI updates where you want to display text as it generates, reducing perceived latency for end-users.

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)

Limits, Errors, and Context

Your context window is 64,000 tokens, with a max output of 16,000 tokens. Limits are 300 requests per minute and 8 concurrent requests per key. Error 401 means your key is invalid; 402 indicates insufficient credit; 429 signals a rate limit. Prompts are not used for training. Content involving minors is strictly blocked.

Questions and answers

What is the context window and output limit?

The total context window is 64,000 tokens for both prompt and completion. The maximum output per request is 16,000 tokens, or 2,048 if you do not set the max_tokens parameter.

Do errors consume my prepaid credit?

No. Errors and refusals are free. You only pay for the tokens successfully processed in the response.

How many API keys can I have?

You have one active key per account. If you generate a new key, the old one is immediately revoked.

Your key is one form away

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

Get API key