Prerequisites and SDK Installation
The API requires a valid API key and a modern SDK. Install the library for your preferred language via pip or npm. We support standard OpenAI client libraries which handle authentication and JSON parsing automatically.
Ensure you have Python 3.8+ or Node.js 18+ installed. The SDKs manage connection pooling and retry logic for you. This reduces boilerplate code significantly.
from openai import OpenAI
client = OpenAI(base_url="https://api.ablatedmodels.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)
Configuring the Base URL and API Key
Point your client to our specific endpoint. Use the base URL provided in your dashboard. Pass your API key in the Authorization header. This ensures requests reach the uncensored infrastructure directly.
Do not use the default OpenAI base URL. Your key will fail if routed incorrectly. Set the base URL in your SDK configuration object before sending any data.
curl https://api.ablatedmodels.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Send me the monthly server uptime report"}]
}'
Sending Your First Chat Completion Request
Send a POST request to /v1/chat/completions. Include your model ID and a messages array. The model responds with text content immediately. No complex routing logic is required.
Keep the payload simple. Start with a single system prompt and one user message. Verify the response structure matches the OpenAI standard. This confirms your integration is working correctly.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.ablatedmodels.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);
Handling Streaming Responses and Tool Use
Enable streaming by setting stream to true. The API returns chunks via Server-Sent Events. Each chunk contains partial text or token usage data. Aggregate these chunks to display real-time output.
Tool use is supported for function calling. Define your tools in the request. The model returns tool calls instead of plain text when appropriate. Parse the tool calls to execute your custom logic.
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)
Understanding Token Limits and Context Window
The context window supports 100,000 tokens total. This includes both input and output tokens. Set max_tokens to limit response length. The default max output is 2,048 tokens if unspecified.
Monitor token usage in the final streaming chunk. Errors do not consume credit. This allows safe experimentation without financial risk. Plan your prompt structure to stay within the limit.
Troubleshooting Common Errors
Check your API key first. A 401 error indicates an invalid or expired key. A 402 error means your prepaid credit is exhausted. Top up via crypto to continue.
A 429 error signals rate limiting. You are limited to 300 requests per minute. Reduce your concurrency or wait before retrying. The 8 MB body limit also triggers 400 errors if exceeded.
Frequently asked questions
What is the uncensored ablated models API?
It is a hosted, OpenAI-compatible API serving a single uncensored LLM. It eliminates content refusals for lawful adult and creative content. Use standard SDKs to integrate it into your app.
Does the uncensored ablated models API support streaming?
Yes, it supports streaming via Server-Sent Events. You can also use function calling and JSON mode. Token usage details are provided in the final chunk.
What happens if I hit the rate limit?
You receive a 429 error. The limit is 300 requests per minute per key. Pause your requests or reduce concurrency to resolve the issue.
Obtain your API key
Register, copy the key, update your base URL. Setup is complete.