Change the OpenAI SDK base URL to an uncensored security model

Set OPENAI_BASE_URL plus OPENAI_API_KEY and your OpenAI SDK code calls an uncensored build: Python, TypeScript, curl, the AI SDK, streaming, JSON, errors, cost.

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

You have scripts on the OpenAI SDK and a model that declines half of what an engagement asks. Every build in this catalog speaks the OpenAI wire format, so pointing those scripts at an uncensored or security-tuned build is two environment variables and no code change. This page shows the calls in Python, TypeScript, curl and the Vercel AI SDK, the error codes, and the live cost of a request.

What you need: two variables

Any client built on the OpenAI API honors OPENAI_BASE_URL and OPENAI_API_KEY. Export both and none of the snippets below needs a URL or a key written into it. Stop the URL at /v1. The key is created in the console, begins with sk-ptl-, is shown to you once, and draws on credit you add from $10.

shell
1export OPENAI_BASE_URL="https://api.pentestllm.ai/v1"
2export OPENAI_API_KEY="sk-ptl-live-…"
OPENAI_BASE_URL
https://api.pentestllm.ai/v1
stops at /v1
OPENAI_API_KEY
sk-ptl-live-…
from the console
model
glm-5.3-uncensored
any id listed on the models page

No install at all: the prompt box on the home page gives a few free turns, and the playground runs the same builds from the browser once you hold a key.

Python

Stock openai package, nothing patched. Because the response keeps the OpenAI shape, scripts you already have for triage or report drafting read it unchanged. The sample asks about a token bypass on an endpoint inside your scope, the kind of question a stock model tends to decline.

main.py
1from openai import OpenAI
2
3client = OpenAI() # reads OPENAI_BASE_URL and OPENAI_API_KEY
4
5response = client.chat.completions.create(
6 model="glm-5.3-uncensored",
7 messages=[{"role": "user", "content": "Explain how a JWT alg=none bypass works and how to test for it on an in-scope login endpoint."}],
8 max_tokens=600,
9)
10print(response.choices[0].message.content)

Streaming is the usual stream=True; chunks arrive while the model writes, which suits long report sections.

stream.py
1with client.chat.completions.create(
2 model="glm-5.3-uncensored",
3 messages=[{"role": "user", "content": "Draft the methodology section of a web application pentest report."}],
4 stream=True,
5) as events:
6 for chunk in events:
7 piece = chunk.choices[0].delta.content
8 if piece:
9 print(piece, end="", flush=True)

TypeScript

The openai npm client accepts baseURL and apiKey as constructor options; read them from the two variables.

main.ts
1import OpenAI from 'openai';
2
3const client = new OpenAI({
4 baseURL: process.env.OPENAI_BASE_URL,
5 apiKey: process.env.OPENAI_API_KEY,
6});
7
8const response = await client.chat.completions.create({
9 model: 'glm-5.3-uncensored',
10 messages: [{ role: 'user', content: 'Explain how a JWT alg=none bypass works and how to test for it on an in-scope login endpoint.' }],
11 max_tokens: 600,
12});
13console.log(response.choices[0]?.message.content);

Vercel AI SDK

Give @ai-sdk/openai the base URL and call provider.chat(id), which keeps requests on Chat Completions, the route every listed build answers. streamText, generateText and generateObject all run on it. The AI SDK guide goes deeper, tool calls included.

route.ts
1import { createOpenAI } from '@ai-sdk/openai';
2import { streamText } from 'ai';
3
4const provider = createOpenAI({
5 baseURL: process.env.OPENAI_BASE_URL,
6 apiKey: process.env.OPENAI_API_KEY,
7});
8
9const result = streamText({
10 model: provider.chat('glm-5.3-uncensored'),
11 prompt: 'Explain how a JWT alg=none bypass works and how to test for it on an in-scope login endpoint.',
12});
13for await (const piece of result.textStream) process.stdout.write(piece);

Prove it with curl

Listing models is free and confirms the key and URL together. The chat call after it is a single billed request.

shell
1curl https://api.pentestllm.ai/v1/models -H "Authorization: Bearer sk-ptl-live-…"
shell
1curl https://api.pentestllm.ai/v1/chat/completions \
2 -H "Authorization: Bearer sk-ptl-live-…" \
3 -H "Content-Type: application/json" \
4 -d '{"model": "glm-5.3-uncensored", "messages": [{"role": "user", "content": "Hello"}]}'

Each response carries a request id header, and a non-streamed response also carries its charge in USD. The usage page of the console shows both.

Cost per request

A request of 600 input tokens and 250 output tokens, across four builds, at the catalog prices of 2026-11-17:

ModelOne request1,000 requests
GLM-5.3 Uncensored$0.00038$0.38
DeepSeek V4.1 Flash Abliterated$0.00093$0.93
GLM-5.3 Flash Uncensored$0.00016$0.16
Kimi K3 Uncensored$0.01$10.62
Uncensored models and their prices per million tokens
GLM-5.3 Uncensoredglm-5.3-uncensoredUncensored$0.282$0.846
DeepSeek V4.1 Flash Abliterateddeepseek-v4.1-flash-abliteratedAbliterated$0.8488$1.6975
GLM-5.3 Flash Uncensoredglm-5.3-flash-uncensoredUncensored$0.1053$0.3685
Kimi K3 Uncensoredkimi-k3-uncensoredUncensored$5.745$28.68

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

JSON, streaming, tools

Ask for a JSON body with response_format set to json_object; findings tables and detection rules are easier to parse that way. If the answer misses the format you asked for, the charge is refunded and the receipt’s refund field says so. stream: true is accepted on every model. Tool calling depends on the base model; each model page states whether its build takes it.

json.py
1response = client.chat.completions.create(
2 model="glm-5.3-uncensored",
3 messages=[{"role": "user", "content": "Return the three OWASP Top 10 categories most likely on a login form as JSON with keys category and first_test."}],
4 response_format={"type": "json_object"},
5)

When it fails

  • 401 invalid_api_key: wrong or revoked key. Recopy it from the console.
  • 402 insufficient_balance: too little credit for this request. 402 monthly_limit_reached: the monthly cap you set on the key is used up.
  • 404 model_not_found: that id is not on the models page. Compare the spelling.
  • 429 rate_limited: the key’s rate limit tripped; wait as long as retry-after says.
  • Nothing is charged for a request that fails before a model answers.

Questions

The API answers the Anthropic messages format too; the Claude Code setup page shows that path. This guide stays on the OpenAI format because every listed build answers it, from the OpenAI SDKs, the Vercel AI SDK, LiteLLM or plain HTTP. See the Claude Code setup page.

Yes. Build a second client with baseURL https://api.pentestllm.ai/v1 and this key, and leave your default client and its variables untouched.

Whatever you set per key in the console; a 429 carries retry-after. Beyond the balance itself there is no account-wide ceiling.

On the models page, or from GET /v1/models with your key, which returns exactly the ids that key may call. See the models page.

Every model above is on the uncensored model list with its live price per million tokens. Per-token pricing sets the whole catalog side by side, and the family directory groups the builds by base model.

Get a keyPrepaid 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.

Help