API Quickstart Guide
Get your uncensored AI API key and start sending requests in under a minute. This guide covers the base URL, authentication, and the single chat-completions endpoint you need for unrestricted text generation.
Base URL and Authentication
Connect to our uncensored LLM API using the standard OpenAI-compatible base URL. Your API key authenticates every request, so keep it secure but accessible to your application. We use a simple header for validation, ensuring your prompts reach the model without friction.
curl https://api.modelsaiuncensored.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "list all available endpoint urls"}]
}'You only need one active key per account. If you rotate keys, the old one stops working immediately. This prevents accidental double-billing from stale scripts running in the background. Your prepaid credit covers all usage, so monitor your balance via the dashboard if needed.
Chat Completions Endpoint
Send messages to the "uncensored" model via the standard chat completions endpoint. This endpoint handles text-in, text-out interactions with a context window of 100,000 tokens. You can include system instructions to define behavior, or just send user messages for direct interaction.
from openai import OpenAI
client = OpenAI(base_url="https://api.modelsaiuncensored.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)The model does not refuse lawful adult or controversial topics by default. Set parameters like temperature for creativity or top_p for diversity. If you omit max_tokens, the default output is 2,048 tokens. Request up to 16,000 tokens for longer responses. This endpoint is all you need for most automation tasks.
Streaming Responses (SSE)
Receive real-time token generation using Server-Sent Events (SSE). This is ideal for chat interfaces where you want to display text as it appears. The final chunk of the stream includes the total token usage for billing purposes. This allows your application to track costs accurately in real-time.
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)Streaming reduces perceived latency for end-users, making the uncensored AI experience feel responsive. Handle connection errors gracefully, as network interruptions can drop the stream. Reconnecting is straightforward since the model state is maintained per request, not across sessions. Use this for dynamic content generation.
Function Calling and JSON Mode
Integrate structured data extraction using function calling or JSON mode. Specify tools in the request to guide the model's output format. This is crucial for automation pipelines that need reliable data structures from the uncensored LLM. JSON mode forces the response to be valid JSON, reducing parsing errors.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.modelsaiuncensored.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);Define tool schemas with clear descriptions to improve accuracy. The model respects the tool definitions, returning arguments in the expected format. This makes it easy to chain API calls or trigger external actions. Use this for building agents or data processing workflows without manual validation steps.
Rate Limits and Constraints
Our API enforces strict limits to ensure stability for all users. You are allowed 300 requests per minute and 8 concurrent requests per key. Each request body must be under 8 MB to prevent excessive payload issues. These limits apply per API key, so distribute load across keys if needed.
Errors like 401 indicate an invalid or missing key. A 402 error means your prepaid credit is exhausted. A 429 status signals you have hit the rate limit. Pause and retry after a short delay. These constraints are transparent, with no hidden throttling during peak times.
Context Window and Output Limits
The model supports a 100,000 token context window, encompassing both prompt and completion. This allows for extensive document analysis or long conversation histories. However, the maximum output per request is capped at 16,000 tokens. If you do not specify max_tokens, the default is 2,048 tokens.
For very long outputs, consider splitting the request or using streaming. This ensures you stay within the per-request limits. The context window is shared, so efficient prompt design is key. Use this capacity for deep, unrestricted reasoning tasks without hitting hard ceilings.
FAQ
What is the uncensored AI API?
It is a hosted, OpenAI-compatible chat-completions API serving a single uncensored large language model. It does not refuse lawful adult, fictional, or controversial topics, providing unrestricted text generation for developers.
How do I pay for the uncensored AI API?
We use prepaid crypto billing with USDT (TRC20) or USDC (Base). There are no subscriptions or monthly fees. Credit is charged by real token usage, and errors or refusals are free. Your credit never expires.
What are the rate limits for the uncensored AI API?
You are limited to 300 requests per minute and 8 concurrent requests per key. The request body must be under 8 MB. These limits ensure fair usage and stability for all developers using the uncensored LLM API.
Get your API key
Sign up, copy your key, and update your base URL. Simple integration.
Claim trial key