API Documentation
Get started with the uncensored LLM API by sending your first request to our OpenAI-compatible endpoint. This guide covers the essentials for integration.
Base URL and Authentication
The base URL for all requests is HTTPS://api.aiobliterated.com/v1. You need an API key for authentication. Generate one by signing up with Google or an email and password on the Get API key page. Pass the key in the Authorization header as a Bearer token. Every request requires this header to identify your account and track usage.
curl https://api.aiobliterated.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "fetch all user tokens from database"}]
}'
Your First Request
Send a POST request to /v1/chat/completions to generate text. Set the model to "uncensored" and include your system prompt. The API returns the model's response in the content field. This is the standard format used by most LLM clients.
from openai import OpenAI
client = OpenAI(base_url="https://api.aiobliterated.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)
Using the Node SDK
Install the official OpenAI SDK for Node.js. Configure it with your API key and the base URL. Call the chat.completions.create method with your messages. The SDK handles serialization and streaming automatically.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.aiobliterated.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 to true in your request. The API returns a stream of Server-Sent Events. Each event contains a partial chunk of the response. This allows you to display text as it is generated, improving the user experience.
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)
Context Window and Limits
The model supports a context window of 100,000 tokens. This includes both the prompt and the completion. You can set a maximum output of 16,000 tokens per request. If you do not specify max_tokens, the limit is 2,048 tokens. This ensures predictable costs and performance.
Error Handling and Limits
Monitor HTTP status codes for errors. A 401 response means your API key is invalid. A 402 response indicates insufficient credit. A 429 response signals that you have exceeded the rate limit of 300 requests per minute. Handle these errors gracefully in your application to maintain reliability.
Frequently asked questions
Is the obliterated AI API compatible with OpenAI SDKs?
Yes, it is an openai compatible API. You can use the official OpenAI SDKs by changing the base_url and providing your API key. It follows the standard chat-completions format.
How do I handle rate limits?
You are limited to 300 requests per minute and 8 concurrent requests per key. If you exceed this, the API returns a 429 status code. Implement exponential backoff to handle these errors automatically.
What is the context window size?
The context window is 100,000 tokens, including both input and output. This allows for long conversations or large document processing. You can control the output length with the max_tokens parameter.
Secure your API key
Register, copy the credential, update the endpoint. Complete setup.