Quickstart: Integrate the unhinged ai API
Get the uncensored API running in minutes. Integrate the unhinged AI API with standard OpenAI-compatible clients and start generating unfiltered text immediately.
Prerequisites: SDK Setup and Base URL
Use any OpenAI-compatible SDK. Point your client at the correct base URL and set your API key. This ensures your requests reach the uncensored model without extra configuration.
- Base URL:
https://api.aiunhinged.cc/v1 - Model ID:
uncensored - Authentication: Bearer token in the
Authorizationheader
curl https://api.aiunhinged.cc/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Generate a JWT token valid for 1 hour"}]
}'
Authenticating With Your API Key
Pass your API key in the Authorization header. The system rejects requests without valid credentials. Errors return clear status codes for debugging.
from openai import OpenAI
client = OpenAI(base_url="https://api.aiunhinged.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)
Sending Your First Completion Request
Send a POST request to /v1/chat/completions. Include the model ID and your messages array. The API returns a text response immediately. This works for stories, scripts, or raw data generation.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.aiunhinged.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);
Streaming Responses With SSE
Enable streaming by setting stream: true. Receive tokens as they generate. This reduces perceived latency for long outputs. The final chunk includes token usage details.
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)
Using Tools and Function Calling
Define tools in your request. The model returns structured arguments. Parse these to execute external functions. This enables dynamic, interactive workflows without manual parsing.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.aiunhinged.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);
Handling Tokens and Limits
Respect the 300 requests per minute limit. The context window supports 100,000 tokens total. Requests exceeding the limit return a 429 status code. Insufficient credit returns 402. Invalid keys return 401. Errors do not consume credits.
Common questions
How do I integrate the uncensored API with existing clients?
Set the base URL to HTTPS://api.aiunhinged.cc/v1 and use your API key in the Authorization header. Any OpenAI-compatible SDK works out of the box. No custom middleware is required.
What happens if I hit the rate limit?
The API returns a 429 status code. You must wait until the window resets. The limit is 300 requests per minute per key. Adjust your request frequency accordingly.
Does the uncensored model support function calling?
Yes. Define tools in your request body. The model returns structured JSON arguments. You can then execute these functions in your application logic seamlessly.
Retrieve your key instantly
Sign up, grab the key, update the base URL. That is the entire configuration.