llamauncensored.com/Quickstart for Llama users
Quickstart for Llama users
Replace your OpenAI configuration with three lines of code to start using an uncensored LLM API that delivers raw model outputs without content filters. This guide covers the immediate integration steps for Python and Node.js clients.
Install the SDK
Start by installing the official OpenAI client library for your preferred language. This ensures compatibility with the /v1/chat/completions endpoint. For Python, use pip to install the package. For Node.js, use npm. These libraries handle serialization and authentication automatically.
- Python:
pip install openai - Node.js:
npm install openai
Set Base URL and Key
Configure the client to point to our infrastructure. You must set the base_url to https://api.llamauncensored.com/v1 and provide your API key. This swap allows existing code to route requests to our uncensored model without changing the core logic. Retrieve your key immediately after signing up via Google or email.
Basic Completion Request
Send a simple text completion to verify the integration. The model ID is uncensored. This request demonstrates a standard text-in, text-out interaction. Ensure your prompt fits within the 100,000 token context window.
curl https://api.llamauncensored.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
}'
Enable Streaming
For lower latency, enable streaming to receive tokens as they are generated. The API supports Server-Sent Events (SSE). Token usage statistics are included in the final chunk of the stream. This method is ideal for real-time user interfaces.
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)
Use Function Calling
The API supports structured tool definitions. You can pass tools and tool_choice parameters to enable function calling capabilities. This allows the model to return structured data for specific tasks. Define your function schemas in the request body.
from openai import OpenAI
client = OpenAI(base_url="https://api.llamauncensored.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)
Force JSON Output
Ensure consistent parsing by forcing JSON mode. Set response_format to {"type": "json_object"}. This instructs the model to output strictly valid JSON. This is useful for programmatic pipelines where format errors break downstream processes.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.llamauncensored.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);
Check Usage and Limits
Monitor your account usage and constraints. You are limited to 300 requests per minute and 8 concurrent requests per key. Request bodies must not exceed 8 MB. Authentication errors return 401 for invalid keys and 402 if prepaid credit is exhausted. Rate limits return 429. Context window totals prompt and completion tokens; output can run to the end of the window unless max_tokens is set lower.
Specs at a glance
Before you integrate, here is exactly what you get with a key.
| Spec | Value |
|---|---|
| API format | OpenAI Chat Completions schema; official openai SDKs work unchanged |
| Base URL | https://api.llamauncensored.com/v1 |
| Methods | POST /v1/chat/completions · GET /v1/models |
| Authentication | Bearer token in the Authorization header |
| Model | uncensored |
| Streaming | Supported (stream: true), usage included at the end |
| Sampling parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| Completion length | prompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap |
| Tools / tool calls | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| JSON mode | JSON object mode via response_format json_object |
| Max context | 100,000 tokens, input and output combined |
| Response headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Requests per minute | 300/min per key |
| Max body | 8 MB request body |
| Concurrency | 8 requests at the same time per key |
| Billing | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Price | $0.15 per 1M input tokens · $0.50 per 1M output tokens |
| Free trial | $0.50 of credit valid 7 days, no card needed · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up |
| Top-up | crypto: USDT on TRON or USDC on Base, $20–$500, any whole sum |
| Credit expiry | paid credit never expires, no subscription |
| Bonus credit | +5% from $50, +10% from $100, +15% from $200 |
| Key management | one active key per account; a new key replaces the old one |
| Sign-in | Google or e-mail and password |
| Content policy | adult content allowed; sexual content involving minors is refused |
Error reference
Errors come back as JSON with a stable type; failed and refused requests are not billed.
| HTTP | Type | What to do |
|---|---|---|
400 | bad_request | invalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend |
401 | missing_key · invalid_key · key_revoked | check the Authorization header or use your current key |
402 | no_credit | out of credit; add credit and retry |
403 | content_blocked | refused by the content policy |
404 | not_found | only /v1/chat/completions and /v1/models exist |
413 | request_too_large | body over 8 MB |
429 | rate_limited · concurrency | slow down: rate or parallel limit reached |
503 | upstream_busy | model busy — retry in a few seconds |
Questions and answers
How do I pay for credits?
Top up by crypto (USDT on TRC20, USDC on Base) with amounts between $20 and $500. Credit never expires and errors are free. PayPal and bank transfers are not accepted.
Is the model uncensored?
Yes, the model answers without content refusals for lawful adult use. The only hard limit is the exclusion of sexual content involving minors.
Can I use my existing OpenAI code?
Yes. By changing the base URL and API key, your existing OpenAI SDK code works immediately. No other changes are required for basic completions.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.