Integration Guide for uncensored ai models
Integrate the uncensored AI API with a single base URL and standard OpenAI-compatible parameters. This guide covers authentication, streaming, and constraints for NSFW LLM implementations.
Base URL and Authentication
Use the provided base URL for all requests. Pass your API key in the Authorization header. The key grants access to the uncensored model without subscription locks.
Authentication is strict. Invalid keys return 401. Ensure you copy the key immediately after generation. The service accepts crypto top-ups only.
First Request
Send a POST request to the chat completions endpoint. The model identifier is uncensored. This returns a direct text response without content filters.
Use the following cURL command to verify connectivity. Replace YOUR_API_KEY with your actual key.
curl https://api.modelsabliterated.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Return the current UTC timestamp in ISO 8601 format"}]
}'Check the response for the choices array. It contains the generated text.
Python SDK Integration
Install the official OpenAI package. Configure the base URL and API key before making calls. This ensures compatibility with the uncensored AI API.
Initialize the client with your credentials. Set the model to uncensored. Send a simple message to test the integration.
from openai import OpenAI
client = OpenAI(base_url="https://api.modelsabliterated.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 response object provides access to the content. Handle exceptions for network errors or authentication issues.
Node SDK Setup
Import the OpenAI library in your Node.js project. Set the base URL and API key in the configuration object. This allows seamless integration with existing codebases.
Create an instance of the client. Pass your credentials. Request completions using the uncensored model.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.modelsabliterated.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);Log the generated text. Ensure you handle asynchronous responses correctly. The API supports standard JSON formats.
Streaming Responses with SSE
Enable streaming by setting stream to true. The server sends Server-Sent Events (SSE). Each chunk contains partial text.
Aggregate the chunks to form the complete response. This reduces perceived latency for long outputs. The final chunk includes token usage statistics.
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)Parse the SSE data stream. Handle errors during streaming. The API ensures consistent token counting.
Rate Limits and Constraints
Observe the rate limits to avoid 429 errors. You get 300 requests per minute per key. Max concurrent requests are 8. The request body must be under 8 MB.
The context window is 100,000 tokens total. Max output is 16,000 tokens. Errors and refusals do not consume credit. Use 402 errors to check for insufficient funds.
Common queries
What is the context window size?
The context window is 100,000 tokens including prompt and completion. Max output per request is 16,000 tokens. If you do not set max_tokens, the default is 2,048.
How do I handle rate limits?
You are limited to 300 requests per minute per key. Concurrent requests are capped at 8. Exceeding these limits returns a 429 status code. Wait before retrying.
Does the uncensored model refuse content?
It refuses only sexual content involving minors. Lawful adult, fictional, and controversial topics pass through without artificial refusals. The guardrails are mathematically scrubbed.
Retrieve your API key
Register, copy your key, and update the base URL. That covers the entire configuration.