Authentication: Setting Your API Key
Your API key authenticates every request. You receive this key immediately after signing up with Google or an email address. Keep it secure, as it grants access to your prepaid credit. The key acts as your sole identifier for rate limits and billing. Rotate it manually via the dashboard if needed, noting that a new key replaces the old one instantly.
Base URL and Endpoint Structure
The base URL is HTTPS://api.chatunfiltered.com/v1. This structure ensures compatibility with standard OpenAI SDKs. You only need to interact with the chat completions endpoint. Embeddings, image generation, and audio processing are not available. Keep your base URL consistent across all client configurations to avoid routing errors.
curl https://api.chatunfiltered.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Check server status"}]
}'
Making Your First POST Request
Send a POST request to /v1/chat/completions to generate text. Include your API key in the Authorization header. Set the model to "uncensored" to access the dedicated uncensored LLM. The request body must contain a messages array with your prompt. Responses return token usage and the generated content. This direct approach minimizes latency compared to multi-model proxies.
from openai import OpenAI
client = OpenAI(base_url="https://api.chatunfiltered.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)
Understanding Response Formats and Streaming
Receive responses in standard JSON format or stream them via Server-Sent Events. Streaming allows you to process tokens as they generate, which improves perceived latency for long outputs. The final chunk in a stream contains the total token usage for accurate billing. You can also enforce JSON mode for structured data outputs. Choose the method that best fits your application architecture.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.chatunfiltered.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);
Configuring Parameters: Temperature, Top-P, and Tools
Adjust temperature and top_p to control response randomness. Use tool_choice for function calling capabilities. The model supports strict JSON mode via response_format. You can also set stop sequences to halt generation at specific points. These parameters allow fine-tuned control over the uncensored model's behavior without external routing layers.
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)
Error Handling and Token Usage Tracking
Handle 401 errors for invalid keys and 402 errors for insufficient credit. Rate limits return 429 when you exceed 300 requests per minute. Your context window spans 100,000 tokens for prompt and completion combined. Errors and refusals do not consume your prepaid credit. Track token usage in the final streaming chunk to manage costs accurately.