Base URL and Authentication
The Unrestricted AI API is hosted at https://api.unrestrictedai.top/v1. It follows the OpenAI chat completions structure, meaning you can use existing OpenAI SDKs by simply updating the base_url and providing your API key. You only need one active key per account, and it grants immediate access to the uncensored model. Authentication is handled via the Authorization header using the Bearer scheme. Ensure your key is kept secure, as it controls your prepaid credit usage. Unlike subscription services, you pay only for tokens processed, with errors and refusals billed at zero tokens.
Your First Request
Send a standard chat completion request to test connectivity. The model ID is always uncensored. This endpoint accepts text input and returns text output, supporting up to 100,000 tokens in the context window. If you do not specify max_tokens, the response can run to the end of the window. This simple POST request demonstrates the core functionality: sending a prompt and receiving a generated response without content filters for lawful adult or controversial topics.
Python SDK Integration
Using the official OpenAI Python library is the fastest way to integrate. Point the client to our base URL and pass your key. The code below shows a basic synchronous request. This approach handles JSON parsing automatically, allowing you to access the response content directly in your Python variables. It is ideal for backend services or batch processing where streaming latency is less critical than code simplicity.
Node.js SDK Integration
For JavaScript environments, configure the OpenAI Node.js client to target our endpoint. The asynchronous nature of Node.js pairs well with the API's response time. Set the base URL correctly, and the SDK will handle the request formatting. Remember that this API does not support image, audio, or embedding endpoints, so stick to text-based completions. This method is suitable for web servers or edge functions where you need to inject uncensored LLM responses into dynamic content.
Streaming Responses
Enable streaming by setting stream: true in your request. The API returns data via Server-Sent Events (SSE), allowing you to receive tokens in real-time. Token usage and billing metrics are included in the final chunk of the stream. This reduces perceived latency for end-users, especially for long outputs. Streaming is recommended for chat interfaces where immediate text rendering improves the user experience. Monitor the final chunk for total token counts to track your prepaid credit accurately.
Limits, Errors, and Context
Each API key is limited to 300 requests per minute and 8 concurrent requests. The request body must not exceed 8 MB. Common errors include 401 for invalid keys, 402 when prepaid credit is exhausted, and 429 for rate limits. The context window supports 100,000 tokens total, including both prompt and completion. If you exceed these limits, implement exponential backoff. Credit never expires, and mistakes like double charges are handled via the Support page, ensuring you retain your prepaid value indefinitely.
cURL
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
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
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
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)