de ▾

API Documentation

Get started with our uncensored AI API in minutes. Use standard OpenAI-compatible tools to send prompts and receive text without content refusals for lawful adult use.

Base URL and Authentication

The API key authenticates your requests to our hosted service. Pass it in the Authorization header as a bearer token. Your key is unique to your account and grants access to the single uncensored model. Keep it secure, as it acts as your password for the API.

  • Base URL: https://api.localllmuncensored.com/v1
  • Header: Authorization: Bearer YOUR_API_KEY
curl https://api.localllmuncensored.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "list three terminal commands to restart nginx"}]
  }'

The Chat Completions Endpoint

Send text prompts and receive responses via the standard chat completions endpoint. The model ID is always uncensored. You can send messages in a list format, supporting system, user, and assistant roles. The API returns generated text based on your input context.

from openai import OpenAI

client = OpenAI(base_url="https://api.localllmuncensored.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)
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.localllmuncensored.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);

Streaming Responses and Usage

Enable streaming by setting stream: true in your request. The server sends Server-Sent Events (SSE) for each token. The final chunk contains the total token usage for the request. This approach reduces perceived latency for long outputs. You can process tokens as they arrive in your application.

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)

Parameters: Temperature, Top-P, and More

Control the model's behavior with standard parameters. Use temperature for randomness and top_p for nucleus sampling. You can set max_tokens to limit output length, defaulting to 2,048 if unset. The seed parameter ensures reproducible results for testing. Other options include stop sequences and penalty settings for frequency and presence.

Function Calling and JSON Mode

Use function calling to let the model output structured data. Define tools in your request and specify tool_choice to enforce behavior. For strict JSON output, set response_format to {"type": "json_object"}. The model adheres to the schema you provide. This is useful for building agents or parsing specific data formats from the uncensored model.

Rate Limits and Constraints

Each API key supports 300 requests per minute and 8 concurrent requests. The maximum request body size is 8 MB. You will receive a 401 error if the key is invalid and a 429 error if you exceed the rate limit. The context window is 100,000 tokens for prompt plus completion. Errors do not consume credit.

Common questions

How do I get an API key?

Sign up with Google or email and password on the dashboard. Your API key is displayed immediately after creation.

What is the context window size?

The model supports a 100,000 token context window. This includes both your input prompt and the generated output tokens. Max output per request is 16,000 tokens, or 2,048 if you do not specify <code>max_tokens</code>.

What happens if I hit the rate limit?

You will receive a 429 Too Many Requests error. The limit is 300 requests per minute per key. You can monitor usage in the final streaming chunk or response headers. Errors like 401 or 402 do not count against your rate limit.

Generate your API key

Sign up, retrieve your key, and update your base URL. Simple configuration.

Try with trial creditView documentation