Unjailed AI API Documentation
Get started with Unjailed AI in seconds using our OpenAI-compatible API. Send a request and receive uncensored text without configuration overhead.
- Base URL
- https://api.aiunjailed.com/v1
- Model
- uncensored
Base URL and Authentication
Use https://api.aiunjailed.com/v1 as your base URL and include your API key in the Authorization header. You receive one active key per account, which you can generate instantly via Google or email on the Get API key page. This setup works with any standard OpenAI SDK by simply overriding the base URL variable. Your key authenticates all requests to the uncensored model endpoint.
curl https://api.aiunjailed.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "list ten terminal commands for linux"}]
}'
First Request
Send a POST request to /v1/chat/completions with the model ID set to uncensored. This single model handles all your text generation needs without routing complexity. You can specify parameters like temperature and top_p to control creativity. The API returns raw text responses directly to your application.
from openai import OpenAI
client = OpenAI(base_url="https://api.aiunjailed.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)
Node SDK Integration
Initialize the client with your API key and the correct base URL to start generating content. Node developers can leverage the official SDK for straightforward promise-based interactions. This approach keeps your code clean while ensuring compatibility with standard request structures. You can adjust the max_tokens to control output length within the 16,000 token limit.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.aiunjailed.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);
Streaming Responses
Enable streaming by setting stream: true in your request body to receive token-by-token updates. This feature uses Server-Sent Events (SSE) for real-time text delivery. Token usage details appear in the final chunk of the stream. Streaming reduces perceived latency for end-users while maintaining full API compatibility.
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)
Model Parameters and JSON Mode
Control generation behavior using standard parameters like temperature, top_p, and stop sequences. You can enforce structured output by setting response_format to {"type": "json_object"}. This ensures the API returns valid JSON for your application logic. Function calling is also supported via the tools parameter for complex workflows.
Limits, Errors, and Context Window
Your context window spans 100,000 tokens for prompt and completion combined, with a maximum output of 16,000 tokens. You are limited to 300 requests per minute and 8 concurrent requests per key. Common errors include 401 for invalid keys, 402 when credit is exhausted, and 429 for rate limits. Requests exceeding the 8 MB body limit will also fail. Errors do not consume your prepaid credit.
FAQ
How do I get started with unjailed AI?
Sign up using Google or email to receive your API key instantly. Then configure your SDK with the base URL and send your first request to the chat completions endpoint.
What is the context window size?
The API supports a 100,000 token context window for both input and output combined. You can specify up to 16,000 tokens for the completion in a single request.
Why am I getting a 402 error?
A 402 error indicates that your prepaid credit has been exhausted. Top up using USDT (TRC20) or USDC (Base) to resume service immediately.
Generate your key
Sign up, copy the key, update your base URL. That is all.