API

API reference

One API, compatible with OpenAI's chat completions, completions and responses and with Anthropic's messages, serving Qwen3.8 27B Uncensored, a model for coding and chat with 262K context. Point the SDK you already use at the base URL and send your key.

Base URL

https://api.unrestricted.sh/v1

OpenAI clients use this base URL. Anthropic clients use https://api.unrestricted.sh, without /v1.

Authentication

Send your key as Authorization: Bearer <key> or in the x-api-key header. Keys start with unr_sk_ and work after your account's first top-up.

Endpoints

POST /chat/completions
OpenAI chat completions, with tool calls
POST /completions
OpenAI text completions
POST /responses
OpenAI Responses API
POST /messages
Anthropic Messages API, with tool use
POST /messages/count_tokens
Anthropic token counting
GET /models
The live models

Paths are relative to the base URL.

Streaming

Set "stream": true and the reply arrives as server-sent events, in the format of the endpoint you called.

OpenAI SDK

python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.unrestricted.sh/v1",
    api_key=os.environ["UNRESTRICTED_API_KEY"],
)

resp = client.chat.completions.create(
    model="qwen3.8-27b-uncensored",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
typescript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.unrestricted.sh/v1",
  apiKey: process.env.UNRESTRICTED_API_KEY,
});

const resp = await client.chat.completions.create({
  model: "qwen3.8-27b-uncensored",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(resp.choices[0].message.content);

Anthropic SDK

python
import os
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.unrestricted.sh",
    api_key=os.environ["UNRESTRICTED_API_KEY"],
)

message = client.messages.create(
    model="qwen3.8-27b-uncensored",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)
for block in message.content:
    if block.type == "text":
        print(block.text)

curl

sh
curl https://api.unrestricted.sh/v1/chat/completions \
  -H "Authorization: Bearer $UNRESTRICTED_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3.8-27b-uncensored",
    "messages": [{"role": "user", "content": "Hello"}],
    "stream": true
  }'

Reasoning

In chat completions the reasoning arrives in reasoning_content, apart from the reply. reasoning_effort caps how long the model reasons before it answers:

none
no reasoning
low (or minimal)
up to 1,024 reasoning tokens
medium
up to 4,096
high (or xhigh, max)
up to 16,384

Without it, reasoning has no cap, and any other value is ignored. On /responses, send it as reasoning.effort. On /messages, thinking.budget_tokens sets the cap and leaving thinking out turns reasoning off.

Limits

Context
262,144 tokens
Requests at once
Up to 3 requests may run at once on an account, 5 on Pro and 8 on Max, shared by your API keys and the playground. One more is refused with 429 until a running request finishes.
Request time
Up to 5.5 minutes per request
Wake fee
A request that wakes a sleeping GPU adds $0.01. Nothing extra is charged while the model is already running.

Privacy

Prompts and completions are never saved or logged.

We keep token counts for billing and a few account events, such as that credit ran out. Never prompts or replies.

No content filters.

The privacy policy lists everything that is kept and why.

Errors

401 invalid_api_key
Missing or revoked API key.
402 insufficient_funds
Out of funds.
403 api_locked
Add funds once to unlock API keys.
404 model_not_found
Unknown model id.
429 concurrent_request_limit
Too many requests running on this account.
503 model_not_available
Model not available.

Errors use OpenAI's error format. /messages answers in Anthropic's format and reports a low balance as 400. The 429 for too many requests at once carries a retry-after header and costs nothing.

More

Pricing, the Qwen3.8 27B Uncensored page, and setup guides for coding agents.