Connect an agent in three settings.
Create a key in the console, set the base URL, pick a model id from the models page. The API speaks the OpenAI format, so the official SDKs and any agent that takes a base URL connect as they are. The service is for authorized security testing only; the acceptable use policy applies to every request.
- Base URL
https://api.pentestllm.ai/v1- Key
sk-ptl-live-…Created in the console, shown once- Model
cyber-frontierAny id from the models page, or auto/security
OpenAI SDK, Python
from openai import OpenAI
client = OpenAI(base_url="https://api.pentestllm.ai/v1", api_key="sk-ptl-live-…")
reply = client.chat.completions.create(
model="cyber-frontier",
messages=[{"role": "user", "content": "Hello"}],
stream=True,
)
for chunk in reply:
print(chunk.choices[0].delta.content or "", end="")OpenAI SDK, Node
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.pentestllm.ai/v1", apiKey: "sk-ptl-live-…" });
const stream = await client.chat.completions.create({
model: "cyber-frontier",
messages: [{ role: "user", content: "Hello" }],
stream: true,
});
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? "");Anthropic SDK and Claude Code
The listed models answer the Messages API at the same host, so Claude Code and anything built on the Anthropic SDK can run one with ANTHROPIC_BASE_URL set to https://api.pentestllm.ai and your key.
import anthropic
client = anthropic.Anthropic(base_url="https://api.pentestllm.ai", api_key="sk-ptl-live-…")
msg = client.messages.create(model="cyber-frontier", max_tokens=1024, messages=[{"role": "user", "content": "Hello"}])
print(msg.content[0].text)Coding agents
In OpenCode, Cline, Cursor or any agent with an OpenAI-compatible provider: add a provider with base URL https://api.pentestllm.ai/v1 and your key, then name the model id. Each model page lists the context window to enter. Setup per agent is under agents.
The security router
Send auto/security as the model and the gateway picks a security build per request from fast, balanced and frontier tiers, billed at that model’s own price. An x-session-id header keeps one model for a run, and "auto": {"tier_max": "balanced"} caps the tier. The router page lists each tier’s models and prices.
Server tools
A request can declare tools that run on our side inside the same request, on a model that takes tools (18 of the 42 listed models today). Fees are read from the live catalog:
- Web search
- $0.01 per search
{"type": "web_search"} - Web fetch
- $0.001 per page fetched
{"type": "web_fetch"} - Code sandbox
- $0.05 per container-hour, 1-minute minimum
{"type": "code_interpreter"} - Remote MCP
- No tool fee
{"type": "mcp", "server_url": …}
curl https://api.pentestllm.ai/v1/chat/completions \
-H "Authorization: Bearer sk-ptl-live-…" \
-H "Content-Type: application/json" \
-d '{
"model": "cyber-frontier",
"tools": [{"type": "web_search"}],
"messages": [{"role": "user", "content": "Summarize the vendor advisory for CVE-2024-3094 and list the fixed versions."}]
}'The code sandbox runs code the model writes in a container on our side, not on your machine. It is for analysis: parsing scan output, decoding a sample, testing a detection rule. Point tools only at systems and data you are authorized to work with.
Headers on every answer
x-uplink-request-id identifies the request for support, x-uplink-charge carries the settled charge on a non-streamed answer, and a streamed answer ends with its usage block. A request that fails before the model answers is not charged.
Machine-readable
The OpenAPI document is at https://api.pentestllm.ai/openapi.json and the model catalog at https://api.pentestllm.ai/v1/catalog, with no key. This site publishes the same list as pricing-index.json, a text index at llms.txt, and a markdown copy of each main page at its path plus .md.