Integrate the Uncensored LLM API in Minutes
Start sending uncensored responses immediately by pointing your existing OpenAI SDK client to our base URL and injecting your API key.
Install the Official OpenAI SDK
Begin by adding the client library to your project environment. This ensures compatibility with standard request formats and streaming protocols without requiring custom HTTP logic.
The package handles authentication headers and JSON serialization automatically. You can proceed to configuration once the dependency is resolved in your workspace.
from openai import OpenAI
client = OpenAI(base_url="https://api.unlimitedllmapi.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)
Configure Base URL and API Key
Direct traffic to our endpoint by setting the base_url variable and injecting your unique key into the client instance. This simple swap routes requests to our optimized uncensored model without altering your code structure.
Verify connectivity by checking the /v1/models endpoint. The system returns the available model identifier, confirming that your credentials are valid and the network path is open.
curl https://api.unlimitedllmapi.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "list all available endpoints for user authentication"}]
}'
Send Your First Chat Completion Request
Construct a standard chat completion payload with the model ID uncensored and your desired messages array. The API processes text input and returns generated text, supporting parameters like temperature and top_p for tone control.
Ensure your request body stays within the 8 MB limit. The system accepts standard JSON objects and returns structured responses that your application can parse immediately.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.unlimitedllmapi.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);
Handle Streaming Responses and Token Usage
Enable streaming by setting the stream flag to true. This returns Server-Sent Events (SSE) chunks, allowing your interface to display tokens progressively as they generate.
Token usage statistics appear in the final chunk of the stream. This approach reduces perceived latency for users while keeping your billing accurate based on actual consumption.
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)
Enable Function Calling and JSON Mode
Activate structured outputs by setting response_format to {"type": "json_object"}. This forces the model to return strictly valid JSON, which is essential for reliable integration with frontend forms or backend services.
You can also define tools in your request body to enable function calling. The model responds with specific function names and arguments, allowing your code to execute external logic based on user intent.
Understand Rate Limits and Context Windows
Your API key supports 300 requests per minute and up to 8 concurrent requests simultaneously. If you exceed these thresholds, the system returns a 429 error until the window resets.
The context window allows 100,000 tokens total, including both prompt and completion. Output is capped at 16,000 tokens per request, or 2,048 tokens if you do not specify max_tokens. Errors and refusals consume no credit.
Frequently asked questions
What causes a 401 or 402 error?
A 401 error indicates an invalid or expired API key. A 402 error means your prepaid credit balance is insufficient to cover the token usage of the current request.
How does the 100,000 token context window work?
The 100,000 token limit applies to the combined total of your input prompt and the generated completion. You can send large documents, but ensure your output request does not exceed the 16,000 token per-request maximum.
Do I need to change my code for streaming?
Yes, you must handle Server-Sent Events (SSE) streams instead of waiting for a single JSON response. Most official SDKs provide a stream iterator that yields tokens sequentially as they are generated.
Your API key is one step away
Sign up, grab the key, update your base URL. That is the entire setup.