Integration Guide: Standard OpenAI SDKs
Connect your application to the abliterated llm api using standard OpenAI SDKs. This guide covers authentication, basic requests, streaming, tool calling, and key limits.
https://api.abliteratedapi.com/v1ModeluncensoredPrerequisites
You need an API key from the abliterated llm api dashboard. Create an account with an email and password to receive your key immediately. No credit card is required for the trial. The base URL for all requests is https://api.abliteratedapi.com/v1. This URL works with the official OpenAI SDKs and any OpenAI-compatible client by setting the base_url and providing your API key.
Authentication
Pass your API key in the Authorization header. The value must be Bearer YOUR_API_KEY. If the key is invalid, you will receive a 401 error. If the key is revoked after regeneration, it will also return 401. If you have insufficient credit, you will receive a 402 error. Keys do not expire; they are only invalidated when you regenerate them.
curl https://api.abliteratedapi.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
}'
Basic Completion
Send a POST request to /v1/chat/completions. The model ID is "uncensored". The API accepts standard message structures. Prompts are not used for training. The model responds with text output. You can send up to 8 MB per request body.
from openai import OpenAI
client = OpenAI(base_url="https://api.abliteratedapi.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)
Streaming Responses
Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE). This allows you to process tokens as they are generated. Streaming works with all standard SDKs. Use this for better user experience in chat interfaces.
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)
Tool Calling
The abliterated llm api supports function calling. Define tools in your request body. The model can select and call these tools. This works with the standard OpenAI format. Ensure your tool definitions match the SDK expectations. This is useful for building agents or automated workflows.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.abliteratedapi.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);
Rate Limits & Limits
You are limited to 300 requests per minute per key. The context window is 64,000 tokens for prompt and completion combined. If you exceed the rate limit, you receive a 429 error. There is no subscription; credit is prepaid and does not expire. Top-ups start at $10. A hard content limit blocks sexual content involving minors.
Questions and answers
Do API keys expire?
No, API keys do not expire. They are only invalidated if you regenerate a new key in your dashboard. You can regenerate your key at any time, which immediately revokes the old one.
What is the context window size?
The context window is 64,000 tokens. This includes both the input prompt and the output completion. You can send up to 8 MB per request body.
What content is blocked?
The model does not refuse lawful adult, fictional, or controversial topics. However, a hard content limit always applies: sexual content involving minors is blocked. Requests of that kind are denied.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.
Get API key