OllamaAbliterated/Ollama Abliterated API Quickstart
Ollama Abliterated API Quickstart
Integrate the uncensored LLM API in minutes using standard OpenAI-compatible clients. This guide covers authentication, request structures, streaming, and billing for the "uncensored" model.
Authentication & Base URL Setup
Configure your client with the provided base URL and API key to begin requests. The endpoint is HTTPS://api.ollamaabliterated.com/v1 and you must pass your key in the Authorization header as a bearer token. This setup works with any OpenAI-compatible SDK by overriding the default base URL.
curl https://api.ollamaabliterated.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Set the system prompt to relaxed mode"}]
}'Register via Google or email on the dashboard to receive your key instantly.
Basic Chat Completion Request
Send a POST request to /v1/chat/completions with the model ID "uncensored" to receive text responses. The model operates without content refusals for lawful adult use, handling controversial or NSFW topics directly. You can control behavior using parameters like temperature and top_p.
from openai import OpenAI
client = OpenAI(base_url="https://api.ollamaabliterated.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)Each request consumes input tokens for the prompt and output tokens for the generated response. Errors and refusals do not consume credit.
Streaming Responses via SSE
Enable streaming by setting stream=true to receive tokens via Server-Sent Events (SSE) in real time. This approach reduces perceived latency for long-form generation and allows progressive UI updates. The final chunk contains the complete token usage statistics for billing accuracy.
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)Handle the stream end event to finalize your response buffer and log the token counts for cost tracking.
Function Calling & Tool Support
Define tools in your request to enable function calling capabilities within the uncensored model. The API supports tool_choice and passes tool definitions in the standard OpenAI format. This allows structured data extraction or action triggering without external parsing logic.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.ollamaabliterated.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);Ensure your tool schemas are valid JSON objects. The model returns tool_calls that you must execute and feed back into subsequent requests if needed.
JSON Mode Configuration
Force strict JSON output by setting response_format to {"type": "json_object"} in your request payload. This mode is ideal for parsing structured data from the LLM without regex post-processing. It ensures the response adheres to valid JSON syntax every time.
Use this for generating configuration files, API payloads, or structured logs. Combine with high temperature values if you need creative JSON variations.
Handling Limits & Errors
Monitor standard HTTP status codes to manage client-side error handling effectively. A 401 indicates an invalid or expired API key, while 402 signals insufficient prepaid credit. A 429 error means you have exceeded the rate limit of 300 requests per minute.
The context window supports 100,000 tokens total, with a maximum output of 16,000 tokens per request. Request bodies must stay under 8 MB. Refunds are not issued for credit, but double charges are resolved via support.
Common questions
How do I top up my credit using cryptocurrency?
You can top up using USDT (TRC20) or USDC (Base) with amounts between $20 and $500. Bonuses apply automatically: +5% for $50+, +10% for $100+, and +15% for $200+. Your credit never expires.
Is the uncensored model the same as Ollama's local models?
No, this is a hosted API serving a specific open-weight model tuned for uncensored responses. While it mimics the behavior of local abliterated models, it runs on our dedicated servers and uses the standard OpenAI-compatible endpoint structure.
What happens if I hit the rate limit?
You will receive a 429 Too Many Requests error. The limit is 300 requests per minute per key. You can generate a new key to reset your quota, as each account allows only one active key at a time.