Abliter API Quickstart
Start using the Abliter API immediately with our OpenAI-compatible endpoint. This quickstart guide covers authentication, coding examples, and pricing details for your uncensored LLM integration.
https://api.abliter.cc/v1uncensored
Base URL and Authentication
Connect to the API using the provided base URL and your unique API key. The endpoint is located at https://api.abliter.cc/v1Authorization header as a Bearer token. This setup works with any standard OpenAI-compatible client library. Authentication is straightforward: generate your key via the dashboard and paste it into your code. No complex OAuth flows or secondary tokens are required for basic access. Your key grants immediate access to the uncensored model capabilities.
Sending Your First Request
Make your first call using the standard chat completions endpoint. This request sends a prompt and receives a text response. You can use curl or any HTTP client to test connectivity. The model ID is uncensored. Ensure you specify the model correctly in your payload. This simple structure allows you to verify that your integration is working before building complex applications. The API returns text directly, ensuring compatibility with existing workflows.
curl https://api.abliter.cc/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "What is the current server status?"}]
}'
Python SDK Integration
Use the official OpenAI Python library to interact with our API. Set the base URL and API key before initializing the client. This approach leverages familiar code structures while accessing our uncensored model. You can send messages and receive responses with minimal boilerplate. The library handles serialization and connection management automatically. This method is ideal for backend services or script-based automations. It ensures your code remains clean and maintainable.
from openai import OpenAI
client = OpenAI(base_url="https://api.abliter.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)
Node.js SDK Integration
Integrate the API into your JavaScript or TypeScript projects using the Node SDK. Configure the client with your base URL and credentials. This allows you to handle requests within asynchronous functions seamlessly. You can manage streaming or synchronous responses based on your needs. The SDK supports modern async/await patterns for clean code. This makes it easy to embed the API into web servers or CLI tools. Ensure your environment supports the required Node version.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.abliter.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 Streaming Responses
Enable streaming for real-time token generation using Server-Sent Events. This feature allows you to display text as it is generated, improving user experience. The API sends chunks of data until the response is complete. You can access token usage details in the final chunk. Streaming is essential for chat interfaces and live applications. It reduces perceived latency and keeps users engaged. Configure your client to handle incremental data streams correctly.
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)
Limits, Errors, and Context Window
Our API enforces specific limits to ensure stability. You get 300 requests per minute and 8 concurrent requests per key. The context window supports 100,000 tokens total, with a max output of 16,000 tokens. Errors like 401 indicate an invalid key, while 402 means insufficient credit. A 429 status signals that you have hit the rate limit. Requests exceeding the 8 MB body size will also fail. Credit never expires, so you can recharge at your own pace. These constraints help maintain high availability for all users.
Common questions
How do I authenticate with the abliter API?
Include your API key in the Authorization header as a Bearer token. You can generate your key on the dashboard after signing up with Google or email. The base URL is HTTPS://api.abliter.cc/v1.
What is the context window size?
The context window supports 100,000 tokens for both prompt and completion combined. You can output up to 16,000 tokens per request. This allows for long conversations and large document processing.
What happens if I get a 429 error?
A 429 error means you have exceeded the rate limit of 300 requests per minute. You can also hit a concurrent request limit of 8. Wait a moment and retry, or reduce the frequency of your requests.