Installation and configuration
Start by installing the official SDK for your language. The client requires only your API key and the correct base URL to route requests to our servers. This setup works with any standard OpenAI-compatible client.
Configure the environment variables or pass them directly to the client constructor. You do not need to manage complex routing logic or switch between multiple models. The single uncensored model handles all requests.
- Install the package via your package manager.
- Set the API key from your dashboard.
- Point the client to the API endpoint.
Making your first request
Send a POST request to the chat completions endpoint with the model ID set to "uncensored". This returns a direct text response from the model, bypassing standard content filters. You can send simple prompts or complex system instructions.
The API accepts standard parameters like temperature and top_p. Use the following cURL command to verify connectivity and response quality immediately.
curl https://api.chatbotunrestricted.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Fetch current temperature in Tokyo."}]
}'This response confirms the model is active and ready for production traffic.
Handling streaming responses
Enable streaming by setting the stream parameter to true. The API returns a server-sent events (SSE) stream, delivering tokens as they are generated. This reduces perceived latency for end-users significantly.
Parse the SSE chunks to update your UI in real-time. The final chunk includes the total token usage for the request. This approach is essential for chat interfaces where users expect instant feedback.
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)Ensure your client handles the stream termination event correctly.
Using tools and function calling
Define tools in your request to let the model output structured data. Pass the tool definitions in the tools array and specify tool_choice for automatic selection. The model returns function calls in the response content.
Parse the function arguments and execute them in your code. Then, pass the results back to the model in a subsequent message. This cycle allows for complex multi-step workflows without external parsing logic.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.chatbotunrestricted.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);Always validate the output schema before execution.
Managing tokens and limits
The context window supports 100,000 tokens for both prompt and completion combined. Each request can output up to 16,000 tokens, or 2,048 if max_tokens is omitted. Monitor your usage via the token counts in the response.
Rate limits allow 300 requests per minute and 8 concurrent requests per key. Exceeding these limits triggers a 429 error. Keep your key unique per account to avoid sharing limits.
Errors like 401 indicate an invalid key, while 402 means you need more credit. Refusals for minor content violations are free and do not consume tokens.
Error handling and troubleshooting
Handle HTTP errors gracefully in your application logic. A 401 status means your API key is incorrect or expired. Check your dashboard to ensure the key is active.
A 402 status indicates insufficient prepaid credit. Top up using USDT or USDC to resume service. The 429 error signals that you have hit the rate limit. Wait and retry with exponential backoff.
Invalid request bodies return a 400 error. Verify your JSON structure matches the API specification. These errors are free and do not deduct from your balance.
Python
from openai import OpenAI
client = OpenAI(base_url="https://api.chatbotunrestricted.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)