---
title: "OpenAI SDK base URL for uncensored models: Python, Node"
canonical: https://unrestrictable.ai/guides/sdks
generated: 2026-11-16T02:57:38.691Z
source: https://unrestrictable.ai/guides/sdks
base_url: https://api.unrestrictable.ai/v1
---

# Point the OpenAI SDK at uncensored models with one base URL

Export OPENAI_API_KEY and OPENAI_BASE_URL; your code stays as it is. Python and TypeScript, curl, the Vercel AI SDK, streaming, JSON output, errors, live cost.

Steps checked October 26, 2026 · prices as of November 16, 2026

Each model in this catalog speaks the OpenAI wire format; the official OpenAI SDKs therefore reach it after two environment variables and nothing else changes. Below: Python and TypeScript, curl, the Vercel AI SDK, the error codes, and the cost of one request at today’s price. Without writing any code, [/chat](https://unrestrictable.ai/chat) runs the same models in the browser, three free turns a day without an account.

## Set two variables

Any SDK that speaks the OpenAI API reads these two variables. Export them once and the snippets below carry no URL and no key. Its base URL ends in `/v1`, and its key is made in the [console](https://app.unrestrictable.ai/console); the key begins with `sk-unr-`, appears a single time, and draws on a prepaid balance that opens at $10.

```bash
export OPENAI_BASE_URL="https://api.unrestrictable.ai/v1"
export OPENAI_API_KEY="sk-unr-live-…"
```

- OPENAI_BASE_URL: https://api.unrestrictable.ai/v1 nothing may follow the /v1
- OPENAI_API_KEY: sk-unr-live-… made in the console
- model: glm-5.3-uncensored any id on the models page

## Python, with the official package

The official `openai` package as installed, nothing patched. Replies have the OpenAI shape, so code that reads OpenAI replies reads these the same way.

```python
from openai import OpenAI

client = OpenAI()  # picks up OPENAI_BASE_URL and OPENAI_API_KEY from the environment

response = client.chat.completions.create(
    model="glm-5.3-uncensored",
    messages=[{"role": "user", "content": "Explain how a lock pick works, step by step."}],
    max_tokens=600,
)
print(response.choices[0].message.content)
```

Streaming uses the flag you already know from OpenAI; chunks arrive as the model produces them.

```python
with client.chat.completions.create(
    model="glm-5.3-uncensored",
    messages=[{"role": "user", "content": "Write a villain's monologue."}],
    stream=True,
) as events:
    for chunk in events:
        piece = chunk.choices[0].delta.content
        if piece:
            print(piece, end="", flush=True)
```

## TypeScript and Node

The `openai` npm package accepts `baseURL` and `apiKey` in its constructor, and the two variables above supply them.

```javascript
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: process.env.OPENAI_BASE_URL,
  apiKey: process.env.OPENAI_API_KEY,
});

const response = await client.chat.completions.create({
  model: 'glm-5.3-uncensored',
  messages: [{ role: 'user', content: 'Explain how a lock pick works, step by step.' }],
  max_tokens: 600,
});
console.log(response.choices[0]?.message.content);
```

## The Vercel AI SDK

Use `@ai-sdk/openai` and give it this base URL. `provider.chat(id)` targets the Chat Completions path, which every listed model speaks; `generateText`, `generateObject` and `streamText` all work.

```javascript
import { createOpenAI } from '@ai-sdk/openai';
import { streamText } from 'ai';

const provider = createOpenAI({
  baseURL: process.env.OPENAI_BASE_URL,
  apiKey: process.env.OPENAI_API_KEY,
});

const result = streamText({
  model: provider.chat('glm-5.3-uncensored'),
  prompt: 'Explain how a lock pick works, step by step.',
});
for await (const piece of result.textStream) process.stdout.write(piece);
```

## Two curl calls

The list call costs nothing and confirms the key and the base URL; the chat call is a single billed request.

```bash
curl https://api.unrestrictable.ai/v1/models -H "Authorization: Bearer sk-unr-live-…"
```

```bash
curl https://api.unrestrictable.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-unr-live-…" \
  -H "Content-Type: application/json" \
  -d '{"model": "glm-5.3-uncensored", "messages": [{"role": "user", "content": "Hello"}]}'
```

Each reply carries a request id header, and a non-streamed reply carries the charge in USD as well. Both show on the console’s usage page.

## Cost of one request

A request of 600 tokens in and 250 out, across four builds, at catalog prices from 2026-11-16:

| Model | Per request | Per 1,000 |
| --- | --- | --- |
| [GLM-5.3 Uncensored](https://unrestrictable.ai/models/glm-5.3-uncensored) | $0.00038 | $0.38 |
| [DeepSeek V4.1 Flash Abliterated](https://unrestrictable.ai/models/deepseek-v4.1-flash-abliterated) | $0.00093 | $0.93 |
| [GLM-5.3 Flash Uncensored](https://unrestrictable.ai/models/glm-5.3-flash-uncensored) | $0.00016 | $0.16 |
| [Kimi K3 Uncensored](https://unrestrictable.ai/models/kimi-k3-uncensored) | $0.01 | $10.62 |

| Model | Build | Input $/M | Output $/M |
| --- | --- | --- | --- |
| [GLM-5.3 Uncensored](https://unrestrictable.ai/models/glm-5.3-uncensored) glm-5.3-uncensored | Uncensored | $0.282 | $0.846 |
| [DeepSeek V4.1 Flash Abliterated](https://unrestrictable.ai/models/deepseek-v4.1-flash-abliterated) deepseek-v4.1-flash-abliterated | Abliterated | $0.8488 | $1.6975 |
| [GLM-5.3 Flash Uncensored](https://unrestrictable.ai/models/glm-5.3-flash-uncensored) glm-5.3-flash-uncensored | Uncensored | $0.1053 | $0.3685 |
| [Kimi K3 Uncensored](https://unrestrictable.ai/models/kimi-k3-uncensored) kimi-k3-uncensored | Uncensored | $5.745 | $28.68 |

Prices per million tokens, read from the live catalog on 2026-11-16.

## Structured output, streaming, tools

Pass `response_format` with `json_object` to request a JSON body; a reply that misses the requested format is refunded, and the receipt’s `refund` field records that. `stream: true` runs on every model. Tool calling runs on the builds whose base model has it; the model page says so.

```python
response = client.chat.completions.create(
    model="glm-5.3-uncensored",
    messages=[{"role": "user", "content": "Give three plot hooks as JSON with keys title and premise."}],
    response_format={"type": "json_object"},
)
```

## Error codes

- `401 invalid_api_key`: a wrong or revoked key. Copy it afresh from the console.
- `402 insufficient_balance`: your balance does not stretch to this request. `402 monthly_limit_reached`: the key reached the spend cap you set on it.
- `404 model_not_found`: no such id on the models page. Compare the spelling.
- `429 rate_limited`: the key reached its rate limit; wait the time given in `retry-after`.
- Nothing is charged for a request that fails before the model replies.

## Questions

### Can I use the Anthropic or Gemini SDK instead?

Not for these models. Each listed build speaks only the OpenAI wire format, which the OpenAI SDK, LiteLLM, plain HTTP and the Vercel AI SDK’s OpenAI provider all reach.

### Can this run beside my existing OpenAI client?

Yes. Build a second client with baseURL https://api.unrestrictable.ai/v1 and this key, and leave the first one as it is.

### What rate limit applies?

One limit per key, configured in the console; a 429 reply includes retry-after. Beyond the balance there is no account-wide cap.

### How do I find the model ids?

On the models page, or by calling GET /v1/models with your key, which returns exactly the ids that key can use. See the models page.

Every model above is on the [uncensored model list](https://unrestrictable.ai/models) with its live price per million tokens. [Per-token pricing](https://unrestrictable.ai/pricing) sets the whole catalog side by side, and the [family directory](https://unrestrictable.ai/uncensored) groups the builds by base model.

[Get a key](https://app.unrestrictable.ai/console) Prepaid from $10, no subscription.

## New models and price changes, once a month.

New uncensored builds with their prices, price moves, and what the daily model check found.
