Authentication: Using Your API Key
Your API key authenticates every request you send to our servers. We issue a single key per account that you generate via the dashboard. Pass this key in the Authorization header using the Bearer scheme. If you send an invalid key, we return a 401 error. If your prepaid credit runs out, we return a 402 error requiring you to top up via crypto before continuing.
Base URL and Endpoint Structure
Direct all requests to our single base URL for chat completions. We do not offer embeddings, image generation, or fine-tuning endpoints. Use the standard POST /v1/chat/completions path to send your prompts. You can also query GET /v1/models to verify the available model identifier. This structure ensures compatibility with existing OpenAI SDK clients without custom routing logic.
Quick Start: Your First Request with ablated AI
Send a simple text request to test the uncensored model immediately. Use the official OpenAI library or any HTTP client to POST your message. The model returns a text response without filtering lawful adult content. Replace the placeholder key with your actual credential from the dashboard.
curl https://api.aiablated.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "what is the current version of the api"}]
}'
This request demonstrates the basic interaction flow. You receive a direct answer from the ablated model. Adjust the system prompt to define the persona or context for your specific use case.
Python SDK Integration
Use the official OpenAI Python library to integrate the API into your applications. Set the base URL and API key in the client configuration. This approach handles serialization and error parsing automatically. You can stream responses or fetch them synchronously. The client library manages the connection lifecycle for you.
from openai import OpenAI
client = OpenAI(base_url="https://api.aiablated.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)
This code snippet initializes the client correctly. It points to our specific base URL. Ensure you install the latest openai package for full compatibility with streaming and function calling features.
Node.js SDK Integration
Integrate the API into your JavaScript or TypeScript projects using the standard SDK. Configure the base URL to point to our service. This allows you to use familiar methods like chat.completions.create. The SDK handles the request headers and response parsing. You can easily add error handling for rate limits or authentication failures.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.aiablated.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);
This configuration ensures your Node application communicates correctly. The base URL override is the critical step. Without it, the SDK will attempt to reach the OpenAI cloud instead of our servers.
Streaming Responses and Token Usage
Receive responses token by token using Server-Sent Events (SSE). This reduces perceived latency for long outputs. The final chunk of the stream contains the total token usage for the request. You can track your prepaid credit consumption in real time. Set stream: true in your request payload to enable this mode. This is ideal for chat interfaces and live text generation.
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)
This streaming approach provides a smooth user experience. The final chunk includes usage statistics. Monitor these numbers to manage your prepaid credit effectively. Errors during streaming are handled gracefully by the SDK.