Quickstart: Integrate Uncensored LLMs API
This guide shows you how to integrate our uncensored model into your application using standard OpenAI-compatible SDKs. You will configure authentication, send your first request, handle streaming, and manage billing without hidden fees.
Prerequisites: SDK and Environment Variables
Start by installing the official OpenAI SDK for your preferred language. We provide a hosted, OpenAI-compatible chat-completions API that works with any standard client. You need to configure two environment variables: OPENAI_API_KEY and OPENAI_BASE_URL.
The base URL for this service is HTTPS://api.llmsunrestricted.com/v1. This URL ensures your requests reach our uncensored infrastructure. Your API key authenticates your prepaid credit account. No phone number is required for setup, just your email or Google account.
Authentication: Setting Your API Key
Authentication relies on a single API key generated during signup. You receive this key immediately after creating an account via Google or email. Store this key securely in your environment variables to avoid exposing it in client-side code.
Our system validates the key against your prepaid balance. If the key is invalid or expired, the API returns a 401 error. You can generate a new key at any time, which replaces the previous one. Keep your key private to prevent unauthorized usage of your tokens.
Sending Your First Chat Completion Request
Send a POST request to the /v1/chat/completions endpoint. Use the model ID uncensored to access our open-weight model tuned for adult and creative content. The model does not refuse lawful topics, ensuring you get the output you expect.
Here is a basic cURL example to verify your connection and billing.
curl https://api.llmsunrestricted.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "List three common use cases for this API"}]
}'This request consumes input tokens based on your prompt length. You are charged only for tokens actually processed. Errors and refusals due to invalid formatting are free.
Handling Streaming Responses (SSE)
Enable streaming by setting stream to true. The API returns data via Server-Sent Events (SSE). This allows you to display tokens to users in real-time, improving the perceived latency of your application.
Token usage statistics are included in the final chunk of the stream. This allows you to track costs accurately per request. Streaming is ideal for chat interfaces where instant feedback is critical.
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 library handles partial responses correctly. The stream ends when the model finishes generating or hits the token limit.
Configuring Parameters: Temperature and Top_P
Adjust generation behavior using standard parameters. Set temperature to control randomness; lower values make outputs more deterministic. Use top_p to limit vocabulary diversity. These settings help you fine-tune the uncensored model for roleplay or creative writing.
You can also use response_format with {"type": "json_object"} for structured data. Function calling is supported via tools and tool_choice. The model supports up to 100,000 tokens for the entire context window.
from openai import OpenAI
client = OpenAI(base_url="https://api.llmsunrestricted.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)These parameters give you full control over the model's output style. Experiment with combinations to find the best balance for your specific use case.
Understanding Token Usage and Billing
Billing is strictly prepaid and based on real token usage. Input tokens cost $0.15 per 1M, and output tokens cost $0.50 per 1M. You pay only for what you use, with no monthly subscription fees. Credit never expires, so you can top up whenever needed.
If you run out of credit, the API returns a 402 error. You can top up with USDT (TRC20) or USDC (Base) starting from $20. Bonuses apply for larger deposits: +5% from $50, +10% from $100, and +15% from $200. Errors do not consume credit.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.llmsunrestricted.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);Monitor your usage via the dashboard or by checking the token counts in the API response headers. This transparency ensures you stay in control of your development costs.
Frequently asked questions
What happens if I hit a rate limit?
The API enforces a limit of 300 requests per minute per key and 8 concurrent requests. If you exceed these limits, you receive a 429 Too Many Requests error. Wait a few seconds and retry, or upgrade your usage pattern to stay within the free limits.
Is the uncensored model truly unrestricted?
Yes, the model is tuned to answer without content refusals for lawful adult, fictional, or controversial topics. The only hard limit is the refusal of sexual content involving minors, which is always enforced. You have full control over other guidelines via prompt engineering.
How do I manage my API keys?
You can generate a new key instantly via the dashboard after logging in with Google or email. Each account has one active key; generating a new one replaces the old one immediately. You can also view your usage and balance details on the same page.
Generate your key now
Sign up, copy the key, update your base URL. That is the entire configuration.