---
title: "PentestGPT Setup: Run It on a Security Model Endpoint"
canonical: https://pentestllm.ai/agents/pentestgpt
generated: 2026-11-11T18:05:14.799Z
source: https://pentestllm.ai/agents/pentestgpt
base_url: https://api.pentestllm.ai/v1
---

![Patch cables in a network switch](https://pentestllm.ai/img/cables.webp)

## Steps

1. ### Install PentestGPT
   PentestGPT’s README asks for Python 3.12 or newer and the `uv` package manager. Clone the repository and install.
   shell
   ```
   git clone https://github.com/GreyDGL/PentestGPT.git
   cd PentestGPT
   make install
   ```
2. ### Put the endpoint and key in .env
   PentestGPT reads provider settings from the environment or from a `.env` file in the directory you run it from. Its `.env.example` lists `OPENAI_BASE_URL` as an optional override for the OpenAI provider. Create a key in the PentestLLM console and set both values.
   .env
   ```
   OPENAI_API_KEY=sk-ptl-live-…
   OPENAI_BASE_URL=https://api.pentestllm.ai/v1
   ```
3. ### Add a security build to the model registry
   PentestGPT only accepts model ids that are in its registry, `pentestgpt_legacy/llm/registry.py`, and its README says adding a model is one `ModelSpec` entry. Add this line inside `_MODEL_LIST`. The arguments are the id, the provider whose connector and key to use, the context window, and a tier label; the window is this build’s figure from the live catalog.
   pentestgpt_legacy/llm/registry.py
   ```
       ModelSpec("gemma-4-26b-a4b-it-cybersecurity", "openai", 262144, "balanced", notes="PentestLLM security build"),
   ```
4. ### Confirm PentestGPT sees the model
   List the registry. The new id should appear under OpenAI, shown as configured because the key is set. The smoke test sends a live request to every configured model and prints a pass or fail for each.
   shell
   ```
   pentestgpt-legacy --list-models
   pentestgpt-legacy --smoke-test
   ```
5. ### Start a session on the security build
   Start the interactive assistant with the build for its reasoning and parsing sessions. You run the commands yourself and paste results back, which is how this mode is designed.
   shell
   ```
   pentestgpt-legacy --reasoning-model gemma-4-26b-a4b-it-cybersecurity --parsing-model gemma-4-26b-a4b-it-cybersecurity
   ```

## What we verified and what we did not

Every PentestGPT detail on this page was read from its repository on 11 November 2026: the README, `.env.example`, and the registry, settings and factory modules of the legacy mode. Those show that the OpenAI provider reads `OPENAI_API_KEY` and an optional `OPENAI_BASE_URL`, and that an unknown model id is rejected unless it is in the registry.

We have not published a tested configuration for PentestGPT’s autonomous pipeline. Its README says that mode uses the authenticated Claude Code or Codex CLI and reads no API key from the `.env` file, and it documents no way to change the endpoint. If you want an autonomous agent on a security build today, use [OpenCode](https://pentestllm.ai/agents/opencode) or [Claude Code](https://pentestllm.ai/agents/claude-code) directly.

## Without editing the registry

If you would sooner not change PentestGPT’s code, create a PentestLLM key with its auto router option set to `auto/security`. A key set that way routes every chat request as the router id whatever model name the client sends. PentestGPT can then be started with one of the stock OpenAI ids already in its registry, and the API will answer with a security build. Check the `model` field of a response, or the usage page in the console, to see which build answered.

## What each setting does

- OPENAI_API_KEY: The credential PentestGPT’s OpenAI connector sends. Your PentestLLM key.
- OPENAI_BASE_URL: Overrides the OpenAI provider’s endpoint. `https://api.pentestllm.ai/v1`.
- ModelSpec(...): Makes an id selectable. The provider `"openai"` reuses the OpenAI-compatible connector and the two variables above.
- --reasoning-model: The model for planning and the task tree.
- --parsing-model: The model that summarizes tool and web output. A fast, low-priced build is enough here.
- --base-url: A command-line override of the base URL for the selected models’ provider, as an alternative to `.env`.

## Why change the model under PentestGPT

PentestGPT’s interactive mode asks its model to reason about a penetration test step after step. On a general model some of those steps are declined. The security builds on PentestLLM are tuned or abliterated to answer security questions other models decline, so the task tree keeps growing. That is reduced refusals, not zero.

Costs are per token; the parsing session handles the bulk of the text, so a low input price there keeps a long session cheap. The table below has the live price of every security build on 2026-11-11.

## Authorized use

PentestGPT’s README carries a disclaimer that it is for educational purposes and authorized security testing only, and the same holds here: PentestLLM is for systems you own or have written permission to test, under the [acceptable use policy](https://pentestllm.ai/acceptable-use). The [PentestGPT alternative](https://pentestllm.ai/pentestgpt-alternative) page explains how the two fit together.

## 9 security builds, priced per token

Read from the live catalog on 2026-11-11. Prices are US dollars per million tokens, paid from a prepaid balance that starts at $10. The id `auto/security` has no price of its own: each request is billed at the build that answered.

| Build | Input | Output | Context |
| --- | --- | --- | --- |
| [Qwen3.8 27B Cybersecurity](https://pentestllm.ai/models/qwen3.8-27b-cybersecurity) | $0.40 | $2.40 | 262,144 |
| [Gemma 4 26B A4B Cybersecurity](https://pentestllm.ai/models/gemma-4-26b-a4b-it-cybersecurity) | $0.4224 | $1.3376 | 262,144 |
| [GLM-5.3 Flash Cybersecurity](https://pentestllm.ai/models/glm-5.3-flash-cybersecurity) | $0.5093 | $1.6975 | 1,048,576 |
| [Red Team (Flash)](https://pentestllm.ai/models/uplink-red-team-flash) | $0.90 | $3.00 | not published |
| [Red Team (Pro)](https://pentestllm.ai/models/uplink-red-team-pro) | $1.50 | $6.00 | not published |
| [OrcaCyber MiniMax M3.1 Flash](https://pentestllm.ai/models/minimax-m3.1-flash-cybersecurity) | $2.00 | $4.00 | 261,632 |
| [OrcaCyber Qwen3.8 Flash Next](https://pentestllm.ai/models/orcacyber-qwen3.8-flash-next) | $2.00 | $4.00 | 261,632 |
| [Cyber Frontier](https://pentestllm.ai/models/cyber-frontier) | $5.25 | $15.75 | 1,048,576 |
| [OrcaCyber Zero 1.5](https://pentestllm.ai/models/orca-zero-1.5-cybersecurity) | $7.50 | $18.75 | 999,488 |

[Full price list and tool fees](https://pentestllm.ai/pricing) · [Every model](https://pentestllm.ai/models) · [API docs](https://pentestllm.ai/docs)

## Questions

- Its interactive mode can. The repository’s .env.example lists an optional OPENAI_BASE_URL override, and the CLI has a --base-url flag. The model id must also exist in PentestGPT’s registry.
- PentestGPT rejects model ids that are not in its registry. Its README says adding a model is one ModelSpec entry, and OpenAI-compatible providers reuse one connector.
- We do not publish a setup for it. In November 2026 its README says the autonomous pipeline drives the Claude Code or Codex CLI and reads no API key from .env, and it documents no endpoint setting.
- A stronger build for reasoning and a fast, low-priced one for parsing. Add a ModelSpec line for each id you want to select.
- PentestGPT is free software. Model usage on PentestLLM is per token; on 2026-11-11 input prices for security builds start at $0.40 per million tokens, prepaid from $10.

## Read next

- [All agent guides The same three values in every supported client.](https://pentestllm.ai/agents)
- [PentestGPT alternative The model endpoint to run PentestGPT on, or to use in place of a chat subscription.](https://pentestllm.ai/pentestgpt-alternative)
- [OpenCode The opencode.json provider block for the security builds.](https://pentestllm.ai/agents/opencode)
- [Kali MCP mcp-kali-server on Kali, driven by a security build through an MCP client.](https://pentestllm.ai/agents/kali-mcp)
- [Claude Code Two environment variables point Claude Code at the Messages endpoint.](https://pentestllm.ai/agents/claude-code)

Facts about other products and tools on this page were read from their own pages on 11 November 2026: [PentestGPT README](https://github.com/GreyDGL/PentestGPT), [PentestGPT .env.example](https://github.com/GreyDGL/PentestGPT/blob/main/.env.example), [PentestGPT model registry](https://github.com/GreyDGL/PentestGPT/blob/main/pentestgpt_legacy/llm/registry.py). They change; check the source before relying on a figure.

## One key, from $10

PentestLLM is for systems you own or have written permission to test. The [acceptable use policy](https://pentestllm.ai/acceptable-use) says what is not allowed.

[Get a key](https://app.pentestllm.ai/console)

usage, 1,000 agent turns on Qwen3.8 27B Cybersecurity

- Input, 8,000 tokens at $0.40 per million: $0.0032
- Output, 1,000 tokens at $2.40 per million: $0.0024
- One turn: $0.0056
- 1,000 turns: $5.60

output price per million tokens, 9 builds

$1.3376 Gemma 4 26B A4B Cybersecurity OrcaCyber Zero 1.5 $18.75
