If you are writing your own tooling on the AI SDK, a triage script, a report drafter, a scope-aware agent, one createOpenAICompatible call puts every build in this catalog behind it, including the security-tuned ones that answer questions a stock model refuses. Below: the provider, then generateText, streamText and tool() against an uncensored build, tool support per build, a Next.js handler, the error codes and the live cost of a call.
What you need
Install ai and @ai-sdk/openai-compatible, the provider package for any server that answers OpenAI Chat Completions. zod only matters for the scope-lookup tool later on.
pnpm add ai @ai-sdk/openai-compatible zod# ornpm install ai @ai-sdk/openai-compatible zodCreate the key in the console. It begins with sk-ptl-, you see it once, and it draws on prepaid credit you add from $10. Export it as a variable so no source file carries it.
export PENTESTLLM_API_KEY="sk-ptl-live-…"Build the provider
Three arguments go into createOpenAICompatible: a name, this API’s baseURL and your apiKey. Stop the URL at /v1, since the SDK appends /chat/completions itself. Set includeUsage or streamed answers come back without token counts, and the cost section further down needs them.
import { createOpenAICompatible } from '@ai-sdk/openai-compatible'; export const uncensored = createOpenAICompatible({ name: 'pentestllm', baseURL: 'https://api.pentestllm.ai/v1', apiKey: process.env.PENTESTLLM_API_KEY, includeUsage: true, // usage in streaming responses too});- name
- pentestllmfree text; the key under which providerOptions addresses this provider
- baseURL
- https://api.pentestllm.ai/v1stops at /v1
- apiKey
- process.env.PENTESTLLM_API_KEYgoes out as Authorization: Bearer
- model
- uncensored('glm-5.3-uncensored')any id on the models page; provider.chatModel(id) does the same
The same URL and key work in the plain OpenAI SDKs and in every other client that speaks this format. For a try without installing anything, the prompt box on the home page gives a few free turns, and the playground runs any build once you have a key.
First reply with generateText
Calling the provider with an id gives you a chat model object for the model field. Back come text, finishReason and a usage object whose inputTokens, outputTokens and totalTokens are exactly what you were charged for. The sample question is one a stock model often declines; the builds here answer it.
import { generateText } from 'ai';import { uncensored } from './provider'; const { text, usage, finishReason } = await generateText({ model: uncensored('glm-5.3-uncensored'), prompt: 'Explain how a JWT alg=none bypass works and how to test for it on an in-scope login endpoint.',}); console.log(text);console.log(usage.inputTokens, usage.outputTokens, usage.totalTokens, finishReason);Streaming, and a route handler
streamText does not wait for the model. Read textStream piece by piece, then await result.usage, which settles once the last chunk arrives. Report drafts are where streaming pays off: the tester reads while the model writes.
import { streamText } from 'ai';import { uncensored } from './provider'; const result = streamText({ model: uncensored('glm-5.3-flash-uncensored'), prompt: 'Draft the executive summary of a web app pentest report: two criticals, one high, remediation first.',}); for await (const piece of result.textStream) process.stdout.write(piece); const usage = await result.usage; // resolves when the stream ends; needs includeUsage on the providerconsole.log(usage.inputTokens, usage.outputTokens);Inside a Next.js route, hand back result.toTextStreamResponse() when the client wants raw text, or result.toUIMessageStreamResponse() when it uses useChat.
// app/api/chat/route.tsimport { streamText } from 'ai';import { uncensored } from '@/lib/provider'; export async function POST(req: Request) { const { prompt } = (await req.json()) as { prompt: string }; const result = streamText({ model: uncensored('glm-5.3-uncensored'), prompt, }); return result.toTextStreamResponse();}Tool calls
A tool() is a description, an inputSchema and an execute function. With stopWhen: isStepCount(5) the SDK runs whatever the model asks for, feeds the result back and repeats, five rounds at most. steps keeps every call and result. The example gives the model a scope lookup, the kind of guardrail an engagement agent should have before it touches a host.
import { generateText, isStepCount, tool } from 'ai';import { z } from 'zod';import { uncensored } from './provider'; const { text, steps } = await generateText({ model: uncensored('glm-5.3-uncensored'), tools: { scope: tool({ description: 'Look up a host in the engagement scope file', inputSchema: z.object({ host: z.string().describe('The hostname or IP to check'), }), execute: async ({ host }) => ({ host, inScope: true, notes: 'prod web tier, test window 02:00-06:00 UTC' }), }), }, stopWhen: isStepCount(5), // keep calling tools for up to 5 steps prompt: 'Is app.example.test in scope, and when may I test it?',}); const toolCalls = steps.flatMap((step) => step.toolCalls);console.log(toolCalls.length, text);Tool use depends on the base model having learned it. When every route of a build accepts tool calls, the catalog adds tools to its supported parameters; on 2026-11-17 that is true of 41 listed builds. The agent tools page lists each of them. None of the builds on this page publishes that field on 2026-11-17, so take an id from that list for agent work and use these for plain answers.
- nemotron-3-ultra-550b-a55b-uncensored
- takes tool callsNemotron 3 Ultra 550B Uncensored
- abliterated-model-large-flash
- takes tool callsAbliterated Large Flash
- abliterated-model-large
- takes tool callsAbliterated Model Large
- abliterated-model-large-v2
- takes tool callsAbliterated Model Large V2
Separate from your own tools, the gateway offers built-in ones: web search and fetch, a remote MCP server, a code sandbox. You declare them in the request’s tools array and they run within that single request; the agent tools page covers them.
Cost per call
Take a call of 2,000 input tokens and 400 output tokens, about what a system prompt plus a short exchange comes to. At the catalog prices of 2026-11-17, the four builds cost:
| Model | One call | 1,000 calls |
|---|---|---|
| GLM-5.3 Uncensored | $0.0009 | $0.90 |
| GLM-5.3 Abliterated | $0.0061 | $6.11 |
| DeepSeek V4.1 Flash Abliterated | $0.0024 | $2.38 |
| GLM-5.3 Flash Uncensored | $0.00036 | $0.36 |
To reconcile an invoice, take usage.inputTokens and usage.outputTokens from each result and multiply by the per-million rates in this table.
| GLM-5.3 Uncensored | Uncensored | $0.282 | $0.846 |
| GLM-5.3 Abliterated | Abliterated | $2.1825 | $4.365 |
| DeepSeek V4.1 Flash Abliterated | Abliterated | $0.8488 | $1.6975 |
| GLM-5.3 Flash Uncensored | Uncensored | $0.1053 | $0.3685 |
Prove the key works
Listing models costs nothing and confirms both the key and the URL. The ids that come back are the ones this key may call.
curl https://api.pentestllm.ai/v1/models -H "Authorization: Bearer sk-ptl-live-…"Each response carries a request id header, and a non-streamed response also carries its charge in USD. Both show on the usage page of the console; the rest of the API is on the docs page.
When it fails
401 invalid_api_key: a wrong or revoked key, or the provider reading a variable you never set. Recopy the key and check the variable name.402 insufficient_balance: not enough credit for this request; add some in the console.402 monthly_limit_reached: the monthly cap you put on the key is used up.403 scope_denied: the key was restricted to a set of models that does not include this one.404 model_not_found: whatever you passed touncensored(‘…’)is not an id on the models page. Ids are not display names; compare the spelling.429 rate_limited: the key’s rate limit tripped. Wait as long asretry-aftersays.- Nothing is charged for a request that fails before a model answers.
Questions
Chat Completions, and every listed build answers it. The builds on this page also list /v1/responses in the catalog, so @ai-sdk/openai works as well: its default openai(id) takes the Responses route, and openai.chat(id) stays on Chat Completions.
It works through openai.chat(id). The compatible provider fits a third-party endpoint better: Chat Completions is its default, includeUsage adds counts to streams, and providerOptions carries any extra request field. See the OpenAI SDK guide.
Same values. OpenCode accepts a custom OpenAI-compatible provider in its config, with this base URL, your key and the model ids unchanged. See the OpenCode guide.
streamText inside the POST handler, then return result.toTextStreamResponse() for text or result.toUIMessageStreamResponse() for a useChat client. The route snippet above is complete.
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.