API Documentation
Drop the uncensored model into your existing codebase with zero configuration overhead. This guide covers the OpenAI-compatible endpoints, authentication, and streaming setup for immediate integration.
Quickstart: Python Integration
The first step is installing the official OpenAI SDK and configuring the base URL. This ensures your client routes requests to our uncensored LLM endpoint without modifying your existing logic.
- Install the package via pip.
- Set the API key and base URL.
- Send a standard chat completion request.
This setup works for both local scripts and production servers.
Authentication and Base URL
Your API key authenticates every request to the base URL HTTPS://api.chatbotsemfiltro.com/v1. The key is generated instantly upon signup and remains valid until you revoke it.
Store the key in an environment variable to avoid hardcoding secrets. The SDK handles header injection automatically.
Chat Completions Endpoint
The core endpoint accepts POST requests to /v1/chat/completions. It expects a JSON body with messages and model parameters.
- Define the role (system, user, assistant).
- Specify the model as "uncensored".
- Receive text output.
This structure mirrors the standard OpenAI format, ensuring compatibility.
Streaming and Function Calling
Enable streaming by setting stream to true. The API returns Server-Sent Events (SSE) chunks, delivering tokens as they are generated.
Function calling is supported via the tools parameter. The model returns tool calls in JSON format, which you can parse and execute.
Parameters: Temperature and Top P
Adjust temperature for creativity or determinism. Values between 0 and 2 control randomness. Top P filters words by cumulative probability.
Combine these parameters to fine-tune the output style. Use seed for reproducible results during testing.
Context Window and Limits
The model supports a 100,000-token context window. Max output is 16,000 tokens per request.
Rate limits are 300 requests per minute. Exceeding this triggers a 429 error. Manage concurrency to avoid throttling.
Error Handling and Tokens
Handle HTTP errors gracefully. 401 indicates an invalid key. 402 means insufficient credit. 429 signals rate limiting.
Token usage is billed accurately. Errors do not consume credit. Monitor usage via the dashboard.
cURL
curl https://api.chatbotsemfiltro.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "List the top ten libraries for Rust async programming"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.chatbotsemfiltro.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)Node.js
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.chatbotsemfiltro.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);Streaming
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)Common questions
Is this an official OpenAI API?
No. It is an OpenAI-compatible API serving a distinct uncensored model. Use the same SDK, but the model id and base URL differ.
How do I handle streaming errors?
Check the SSE event type. If it is an error event, parse the message and handle it without consuming tokens.
What happens if I exceed the rate limit?
The API returns a 429 status code. Wait and retry with exponential backoff to avoid repeated failures.
Get your API key instantly
Register, retrieve your key, and update your base URL. That is the complete configuration.