API Documentation & Quickstart
Get started with the uncensored LLM API in minutes. Drop this drop-in replacement into your existing codebase and start generating text without content filters.
Base URL and Authentication
Use our base URL and a single API key to connect. The endpoint accepts standard headers. Replace YOUR_API_KEY with the string from your dashboard.
- Base URL:
https://api.ollamaopenaicompatibleapi.com/v1 - Model ID:
uncensored
Authentication relies on a bearer token. Pass it in the Authorization header. This ensures compatibility with any OpenAI SDK compatible client. You can generate a new key instantly via Google or email. No phone number is required.
Chat Completions Endpoint
Send a POST request to /v1/chat/completions. Include your messages array and model name. The API returns text output based on your prompt. This works with any provider using standard parameters.
Set the temperature for creativity or keep it low for precision. You can also define stop sequences. The server processes the request and returns the completion. This is the core interaction for most integrations.
Remember that errors do not consume your prepaid credit. Only successful completions are billed. This protects your budget during debugging phases.
curl https://api.ollamaopenaicompatibleapi.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "List the top 10 Linux kernel security patches from 2023"}]
}'
Streaming Responses via SSE
Enable streaming by setting stream: true. The server sends chunks as they are generated. This reduces perceived latency significantly. You receive partial responses in real-time.
Parse the Server-Sent Events stream. The final chunk contains usage statistics. This includes token counts for both input and output. You can track costs dynamically during generation.
This approach works well for chat interfaces. Users see text appearing word by word. It feels more responsive than waiting for the full response. The API handles the connection stability automatically.
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)
Function Calling and JSON Mode
Define tools in your request body. The model can output structured data. Use response_format with {"type": "json_object"} for strict JSON. This ensures parseable output every time.
Tool definitions include name, description, and parameters. The model decides which tool to call. You execute the function and feed results back. This enables complex agent workflows.
JSON mode disables free-text generation. It forces the model to adhere to your schema. Use this when integrating with databases or APIs. It reduces hallucination in structured fields.
from openai import OpenAI
client = OpenAI(base_url="https://api.ollamaopenaicompatibleapi.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)
Rate Limits and Request Bodies
You get 300 requests per minute per key. Concurrency is limited to 8 simultaneous requests. The maximum request body size is 8 MB. This suits most text-heavy applications.
Context window allows 100,000 tokens total. This includes both prompt and completion. Max output per request is 16,000 tokens. If you omit max_tokens, it defaults to 2,048.
Handle HTTP 429 errors gracefully. They indicate you hit the rate limit. Implement exponential backoff in your client code. This prevents overwhelming the server during spikes.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.ollamaopenaicompatibleapi.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);
Authentication Errors and Limits
A 401 status means your key is invalid. Check for typos or expired sessions. A 402 status indicates insufficient credit. Top up via crypto to resume service.
A 429 status signals rate limiting. You exceeded 300 requests per minute. Reduce your throughput or upgrade your key. The API returns clear error messages.
Credit never expires. You can top up anytime. Minimum top-up is $20. Bonus credits apply for larger amounts. This keeps your project running smoothly.
FAQ
What is the uncensored LLM API base URL?
The base URL is HTTPS://api.ollamaopenaicompatibleapi.com/v1. Use this endpoint for all chat completions requests. It works with standard OpenAI SDKs.
How much context window does the model support?
The model supports a 100,000 token context window. This covers both prompt and completion tokens. Max output per request is 16,000 tokens.
What happens if I hit the rate limit?
You receive a 429 HTTP status code. This means you exceeded 300 requests per minute. Wait a few seconds and retry with backoff.
Get your key in a minute
Sign up, grab the key, update the base URL. Done.