Uncensored AI Model API Quickstart
Get started with the uncensored AI model API in minutes. This quickstart guides you through authentication, sending requests, and handling streaming responses with our OpenAI-compatible endpoint.
Authentication
Start by generating your API key on the Get API key page. You can sign up with Google or use an email and password; no phone number is required. Your key appears immediately and is the only credential needed for all requests.
- Base URL:
https://api.unrestrictedaimodel.cc/v1 - Model ID:
uncensored - Auth Header:
Authorization: Bearer YOUR_API_KEY
Keep your key secure. If you generate a new one, the old key is deactivated immediately. There is no need to manage subscriptions; simply top up your prepaid credit by crypto (USDT on TRC20, USDC on Base) to continue using the service.
Chat Completions Endpoint
The core of the API is the chat completions endpoint. It accepts standard OpenAI-style JSON payloads and returns text responses. This is a pure text API, so there are no embeddings, image, or audio generation endpoints to manage.
Send your prompt in the messages array. The system will return a generated response based on the uncensored model, which does not refuse lawful adult, controversial, or technical topics.
Here is a basic cURL example to get started:
curl https://api.unrestrictedaimodel.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."}]
}'Ensure you replace YOUR_API_KEY with your actual key. The response will include the generated text in the choices array.
Python SDK Integration
Using the official OpenAI Python SDK is the recommended way to integrate the uncensored LLM into your applications. Since our API is OpenAI-compatible, you only need to change the base URL and API key.
This approach allows you to use familiar methods like client.chat.completions.create() while benefiting from the model's unrestricted nature. It is particularly effective for uncensored coding tasks or generating large volumes of text without content filters.
Install the SDK and configure the client as shown below:
from openai import OpenAI
client = OpenAI(base_url="https://api.unrestrictedaimodel.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)Remember to set the model to uncensored to ensure you are using our specific uncensored model and not a generic default.
Node SDK Integration
For JavaScript and TypeScript projects, the OpenAI Node SDK provides a straightforward integration path. Similar to Python, you just need to point the client to our base URL.
This is ideal for web applications or server-side scripts that need to generate text dynamically. The SDK handles the HTTP requests and JSON parsing automatically.
Here is how you can initialize the client and make a request:
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.unrestrictedaimodel.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);Make sure to handle errors appropriately, especially rate limits or insufficient credit, to ensure a robust user experience in your application.
Streaming Responses
For real-time user experiences, you can enable streaming by setting stream: true. The API will send a series of Server-Sent Events (SSE), allowing you to display tokens as they are generated.
This is useful for chat interfaces or long-form content generation where waiting for the full response is too slow. The final chunk of the stream includes the total token usage, which is then deducted from your prepaid credit.
Here is an example of how to handle streaming in your code:
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)Ensure your UI is set up to render text incrementally as chunks arrive. This provides a smoother, more responsive feel compared to waiting for the entire completion.
Limits, Errors, and Context
Our API has specific limits to ensure reliability. You can make up to 300 requests per minute per key, with a maximum of 8 concurrent requests. The request body size is capped at 8 MB.
Be aware of common HTTP errors:
- 401 Unauthorized: Invalid or expired API key.
- 402 Payment Required: Insufficient prepaid credit. Top up by crypto (USDT on TRC20, USDC on Base).
- 429 Too Many Requests: You have exceeded the rate limit. Wait a moment and retry.
The context window is 100,000 tokens total (prompt + completion). If you do not specify max_tokens, the response can run to the end of the window. Plan your prompts accordingly to avoid truncation.
API facts in one table
Before you integrate, here is exactly what you get with a key.
| Item | Value |
|---|---|
| Compatibility | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Base URL | https://api.unrestrictedaimodel.cc/v1 |
| Model ID | uncensored |
| Endpoints | POST /v1/chat/completions · GET /v1/models |
| Authentication | Authorization: Bearer YOUR_KEY |
| Tools / tool calls | Supported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages |
| SSE streaming | Yes — server-sent events; the last chunk carries token usage |
| Max context | 100,000 tokens, input and output combined |
| Structured output | JSON object mode via response_format json_object |
| Sampling parameters | temperature, top_p, stop, seed, presence_penalty, frequency_penalty |
| Completion length | up to the rest of the 100,000-token window; max_tokens optional (no separate cap) |
| Request size | up to 8 MB per request |
| Requests per minute | 300/min per key |
| Headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Concurrency | 8 requests at the same time per key |
| Payment | crypto: USDT on TRON or USDC on Base, $20–$500, any whole sum |
| Bonus credit | +5% from $50, +10% from $100, +15% from $200 |
| Price | $0.15 per 1M input tokens · $0.50 per 1M output tokens |
| Subscription | paid credit never expires, no subscription |
| Free trial | $0.50 of credit valid 7 days, no card needed · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up |
| How you pay | prepaid credit, charged by real token usage; errors and refusals are free |
| Sign-in | Google or e-mail and password |
| Keys | one key per account, regenerate any time (the old one stops working) |
| Content | adult content allowed; sexual content involving minors is refused |
When a request fails
Errors come back as JSON with a stable type; failed and refused requests are not billed.
| Code | Type | Meaning |
|---|---|---|
400 | bad_request | invalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend |
401 | missing_key · invalid_key · key_revoked | no key, wrong key, or a key replaced by a newer one |
402 | no_credit | balance is empty — top up, requests resume at once |
403 | content_blocked | sexual content involving minors — refused, not billed |
404 | not_found | unknown endpoint |
413 | request_too_large | request body larger than 8 MB |
429 | rate_limited · concurrency | slow down: rate or parallel limit reached |
503 | upstream_busy | temporary overload, retry shortly |
Questions and answers
Is this API suitable for uncensored coding tasks?
Yes, the uncensored coding LLM is designed to provide code outputs without unnecessary refusals for common coding scenarios. It is ideal for developers who need unrestricted code generation and explanation.
How do I handle errors like 402 or 429?
A 402 error means you need to add credit by crypto (USDT on TRC20, USDC on Base). A 429 error indicates you have hit the rate limit of 300 requests per minute. Wait briefly and retry, or spread your requests over time.
Can I use this API with other OpenAI clients?
Absolutely. Since we use the OpenAI-compatible format, any client that supports custom base URLs and API keys will work. Just update the base URL to https://api.unrestrictedaimodel.cc/v1 and set the model to uncensored.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.