EN ▾

OpenAI-compatible API for uncensored LLMs

Quickstart for Mistral users

Migrate your client code to an uncensored backend by updating the base URL and API key. This guide covers the standard OpenAI-compatible endpoints with no subscription locks and transparent token pricing.

Prerequisites: SDK and Key

To begin, you need an API key and a supported SDK. Visit the Get API key page and sign in with Google or use an email and password. The key is displayed immediately; no phone number is required. You can also start with a free trial of $0.50 valid for 7 days. Claim this credit with one click on your API key page.

Install the official SDK for your language. For Python, use pip install openai. For Node.js, use npm install openai. These libraries handle the HTTP requests, so you only need to configure the connection details correctly.

Base URL Configuration

The core of this integration is the base URL. Unlike standard providers, you must point your SDK to our dedicated endpoint. This allows you to keep your existing client code while switching to an uncensored model.

Set the base_url to https://api.mistraluncensored.com/v1 and provide your API key in the api_key field. The model identifier is simply uncensored.

Basic Chat Completion

Send a standard chat completion request. The API accepts a list of messages and returns a text response. This endpoint supports the full range of parameters including temperature, top_p, and stop sequences. Note that the context window is 100,000 tokens for input and output combined.

Streaming Responses

Enable streaming by setting stream: true. The API returns Server-Sent Events (SSE). Token usage statistics, such as input and output counts, are included in the final chunk of the stream. This is ideal for real-time UI updates.

Function Calling (Tools)

The API supports function calling via the tools parameter. You can define custom tools and let the model decide which to invoke. Use tool_choice to force specific behavior. The model returns tool calls in the standard OpenAI format, making it easy to integrate with existing function execution logic.

JSON Mode Enforcement

For structured data, set response_format to {"type": "json_object"}. The model will enforce JSON output, ensuring your parser receives valid syntax. This is useful for generating data structures, configuration files, or API responses without additional post-processing.

cURL

curl https://api.mistraluncensored.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."}]
  }'

Python

from openai import OpenAI

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

import OpenAI from "openai";

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

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)

Capabilities and limits

If your tool speaks the OpenAI API, these are the details that matter.

ParameterDetails
ProtocolOpenAI Chat Completions schema; official openai SDKs work unchanged
Base URLhttps://api.mistraluncensored.com/v1
Modeluncensored
MethodsPOST /v1/chat/completions · GET /v1/models
AuthenticationAuthorization: Bearer YOUR_KEY
Context window100,000 tokens, input and output combined
StreamingSupported (stream: true), usage included at the end
Completion lengthprompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap
Sampling parameterstemperature, top_p, stop, seed and the two penalties are passed through
Structured outputJSON object mode via response_format json_object
Tools / tool callsYes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool
Concurrency8 requests at the same time per key
Rate limit300/min per key
Max bodyup to 8 MB per request
HeadersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Top-upUSDT (TRC20) or USDC (Base), any whole amount from $20 to $500
Billingprepaid credit, charged by real token usage; errors and refusals are free
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
Priceinput $0.15 / 1M tokens, output $0.50 / 1M tokens
Subscriptionno monthly fee; paid credit does not expire
Volume bonus+5% from $50, +10% from $100, +15% from $200
Key managementone key per account, regenerate any time (the old one stops working)
Content policyuncensored for adults; the only hard rule: no sexual content involving minors
Accountsign in with Google or with e-mail + password

Error reference

Every error is JSON with a type you can switch on. You are never charged for an error.

StatusTypeReason
400bad_requestinvalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend
401missing_key · invalid_key · key_revokedno key, wrong key, or a key replaced by a newer one
402no_creditout of credit; add credit and retry
403content_blockedsexual content involving minors — refused, not billed
404not_foundonly /v1/chat/completions and /v1/models exist
413request_too_largebody over 8 MB
429rate_limited · concurrencyover 300/min or 8 parallel — back off and retry
503upstream_busytemporary overload, retry shortly

Questions and answers

What are the rate limits?

You are limited to 300 requests per minute per key and 8 concurrent requests. The request body must be under 8 MB. If you exceed these limits, you will receive a 429 error.

How do I handle authentication errors?

A 401 error indicates an invalid or missing API key. Ensure you are using the key generated on the dashboard. A 402 error means your prepaid credit is exhausted; top up by crypto (USDT on TRC20, USDC on Base) to resume.

Is the context window 100k input or total?

The 100,000-token limit applies to the sum of the prompt and the completion. There is no separate output cap, and if you do not specify max_tokens, the response can run to the end of the window.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API keyRead the docs