EN ▾
Claim trial key

API Documentation: Uncensored LLM Endpoint

Start building with our uncensored LLM API in minutes. The interface matches the OpenAI standard, so you can swap your base URL and key to get immediate access to unrestricted content generation.

Base URL and Authentication

Your API key authenticates every request to our endpoints. We issue one active key per account, replacing any previous key immediately upon generation. This design keeps your access simple and secure without complex permission scopes.

Point your client to our base URL and pass the key in the header. The system rejects invalid keys with a 401 status code. You never need to manage multiple keys or wait for approval.

First Request with cURL

Verify your integration works by sending a simple text completion. Use the uncensored model id to ensure you receive unrestricted responses without content filters.

This request demonstrates the basic structure required for our API. Replace YOUR_API_KEY with your actual credential.

curl https://api.modelsunlocked.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Set the server port to 8080 and restart"}]
  }'

Python SDK Integration

Use the official OpenAI Python library to interact with our endpoint. Set the base URL and API key before creating your client instance. This approach ensures compatibility with existing codebases.

from openai import OpenAI

client = OpenAI(base_url="https://api.modelsunlocked.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)

Node.js SDK Setup

Integrate our uncensored LLM into your JavaScript applications using the standard SDK. Configure the client with your specific base URL and key.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.modelsunlocked.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 via SSE

Enable streaming by setting the stream parameter to true. Our API returns Server-Sent Events (SSE) for real-time token delivery. Each chunk contains partial text, allowing your application to display results incrementally.

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)

Limits, Errors, and Context Window

Your account supports a 100,000 token context window, combining prompt and completion tokens. You can send up to 300 requests per minute with a concurrency limit of 8 simultaneous requests. If you exceed these limits, the API returns a 429 rate limit error. Insufficient credits result in a 402 error. Ensure your request body stays under 8 MB.

Technical FAQs

What is the base URL for the unlocked models API?

The base URL is HTTPS://api.modelsunlocked.com/v1. You must update your client configuration to point to this address instead of the standard OpenAI endpoint.

How do I handle authentication errors?

If you receive a 401 status code, your API key is either invalid or expired. Check your dashboard to ensure you are using the correct key. Regenerate a new key if necessary.

What happens if I run out of credits?

Requests fail with a 402 status code when your prepaid credit is depleted. You can top up immediately using crypto to resume service without losing your place in the queue.

Access requires one step

Register, retrieve your token, and update the base URL. Complete.