You live in Zed and want its agent to read the code you are auditing without a lecture about hacking. Zed’s Agent Panel accepts an OpenAI-compatible provider in settings.json: an API URL, model ids with their context windows, and a key kept in the keychain or an environment variable. With one block, a security-tuned or uncensored build answers in the panel and makes tool calls for edits and terminal commands. The block below already carries the PentestLLM URL and the ids Zed users run on this API.
What you need
- Zed with the Agent Panel available.
- A key from the console with prepaid credit behind it.
- Model ids and their context windows from the models page. Zed cannot discover models, so each one is typed in by hand. The security-tagged builds are tuned for engagement work; auto/security routes by request difficulty.
Which file, which menu
The provider belongs in Zed’s user settings: ~/.config/zed/settings.json on macOS and Linux, %APPDATA%\Zed\settings.json on Windows. The command palette entry zed: open settings file opens it. A project’s .zed/settings.json accepts editor and language options only, so a provider written there is ignored.
There is a UI route as well. agent: open settings (also in the Agent Panel’s top-right menu) lands on Settings → AI → LLM Providers, and Add Provider wants a provider name, an API URL, one model ID and its context window. That page also takes the key, or Zed reads it from an environment variable. The key is never written to settings.json.
Shortest path to a first reply
- Paste the block below into
settings.json. Every entry underavailable_modelsmust carrymax_tokens, so the three ids shown are the first builds in the list further down whose context window the catalog publishes. Any other id from the models page goes in the same shape with the window from its page.agent.default_modelmakes the first entry the model for new threads:
{ "language_models": { "openai_compatible": { "pentestllm": { "api_url": "https://api.pentestllm.ai/v1", "available_models": [ { "name": "deepseek-v4.1-flash-1017-uncensored", "display_name": "DeepSeek V4.1 Flash 1017 Uncensored", "max_tokens": 1048576, "capabilities": { "tools": true, "images": false, "parallel_tool_calls": false, "prompt_cache_key": false } }, { "name": "glm-5.3-flash-apex-abliterated", "display_name": "GLM-5.3 Flash Apex Abliterated", "max_tokens": 1048576, "capabilities": { "tools": true, "images": false, "parallel_tool_calls": false, "prompt_cache_key": false } }, { "name": "kimi-k3-uncensored", "display_name": "Kimi K3 Uncensored", "max_tokens": 262144, "max_output_tokens": 65536, "capabilities": { "tools": true, "images": true, "parallel_tool_calls": false, "prompt_cache_key": false } } ] } } }, "agent": { "default_model": { "provider": "pentestllm", "model": "deepseek-v4.1-flash-1017-uncensored" } }}- Make a key in the console. Hand it to Zed either through the UI (
agent: open settings, locate pentestllm under LLM Providers, paste; Zed keeps it in the system keychain) or by exporting it in the environment Zed launches from, under the variable name derived from the provider id:
export PENTESTLLM_API_KEY="sk-ptl-live-…"- Start a thread (
agent: new thread, or click the sparkle icon in the status bar) and send a message. Try asking for a severity-ranked list of what a service scan of an in-scope host exposes, or a review of a client module for injection bugs. The selector in the message editor (cmd-alt-/on macOS,ctrl-alt-/elsewhere) switches to another id under pentestllm, and the choice is written back toagent.default_model.
An environment variable with a value beats the keychain entry. To retire a key supplied by the variable, unset it, then restart Zed. To try a build with no editor involved, the home page gives a few free demo turns and the playground runs every id on a key.
The settings, one by one
- openai_compatible.pentestllm
- the provider idshown in the model selector, used as provider in agent.default_model, and the stem the env var name is built from
- api_url
- https://api.pentestllm.ai/v1the request destination; keep the trailing /v1 and add nothing after it
- available_models[].name
- deepseek-v4.1-flash-1017-uncensoredthe id put on each request, spelled as the models page prints it; the selector lists only what is written here
- available_models[].display_name
- the name in the pickeroptional; the raw id appears when it is absent
- available_models[].max_tokens
- the context windowrequired; by default Zed compacts a thread at 90% of this number, so use the catalog’s figure
- available_models[].max_output_tokens
- the output limitoptional; forwarded as max_completion_tokens on every request
- available_models[].capabilities
- { tools, images, parallel_tool_calls, prompt_cache_key }tools is on unless you turn it off, and the agent cannot edit or run commands without it; images mirrors the catalog; leave the last two false
- agent.default_model
- { provider: pentestllm, model: deepseek-v4.1-flash-1017-uncensored }the model a new thread opens on; the role settings for the inline assistant, commit messages, thread summaries and compaction take the same object
- PENTESTLLM_API_KEY
- the whole sk-ptl- keythe variable Zed checks for this provider id; pasting the key in the settings UI, which stores it in the keychain, is the alternative
Which build, and what a turn costs
Zed posts OpenAI-format chat completions to api_url; every id on the models page replies in that format. One agent turn carries the whole thread, each file Zed opened and every tool result to date, so input tokens set the price and the build with the lowest input rate costs least per turn. The right-hand column says whether a build accepts tool calls. A build that does not gets a No tools badge in the selector, and the agent can neither edit files nor run commands with it.
The context window counts twice. Zed compacts a thread once it hits 90% of the entry’s max_tokens (the agent.auto_compact threshold), so a longer window means fewer compactions and more of the thread kept word for word. Below 80,000 tokens auto-compaction is off entirely; Zed shows a banner near the ceiling and offers a fresh thread seeded with a summary. The compaction call goes to the thread’s own model and is billed like any other request, unless agent.compaction_model sends it to a smaller build.
| GLM-5.3 Uncensored | Uncensored | $0.282 | $0.846 |
| GLM-5.3 Flash Uncensored | Uncensored | $0.1053 | $0.3685 |
| DeepSeek V4.1 Flash Abliterated | Abliterated | $0.8488 | $1.6975 |
| DeepSeek V4 Pro Uncensored | Uncensored | $0.97 | $1.94 |
| GLM-5.3 Abliterated | Abliterated | $2.1825 | $4.365 |
| GLM-5.3 Flash Code Uncensored | Uncensored | $6.00 | $6.00 |
| DeepSeek V4.1 Flash 1017 Uncensored | Uncensored | $0.8003 | $3.201 |
| GLM-5.3 Flash Apex Abliterated | Abliterated | $0.80 | $3.20 |
| Kimi K3 Uncensored | Uncensored | $5.745 | $28.68 |
For source review on an engagement, the uncensored coding AI guide ranks the code builds and prices a full day on each. The same ids run in Cursor and OpenCode, and behind a router in Claude Code.
Prove it outside Zed
Ask the API which models your key may call. Each name in your available_models should appear in the list:
curl https://api.pentestllm.ai/v1/models -H "Authorization: Bearer sk-ptl-live-…"Then replay the kind of request Zed sends. -i shows the response headers, which include a request id and, when the answer is not streamed, the charge in USD.
curl -i https://api.pentestllm.ai/v1/chat/completions \ -H "Authorization: Bearer sk-ptl-live-…" \ -H "Content-Type: application/json" \ -d '{"model": "deepseek-v4.1-flash-1017-uncensored", "messages": [{"role": "user", "content": "Reply with the single word ok."}]}'Back in Zed, start a new thread with one of your ids selected and send a message. It lands on the console’s usage page with its token counts and charge. The thread’s running token count sits near the profile selector in the message editor and rises toward the max_tokens you entered.
When it breaks
401 invalid_api_key: either the key itself is bad, or a stalePENTESTLLM_API_KEYin Zed’s environment is shadowing the keychain entry. Re-copy the key in the console, or unset the variable before restarting Zed.404 model_not_found: one of youravailable_modelsentries has anamethat is not a real id. Compare the spelling, and remember the id goes inname, notdisplay_name.402 insufficient_balance: credit ran out; add some in the console.402 monthly_limit_reached: the key hit the monthly cap you gave it.403 scope_denied: this key is restricted to certain models, and the chosen one is outside that list.429 rate_limited: too many requests on the key; wait out theretry-afterthe response names.- LLM provider is not configured or does not support the configured model: Zed could not resolve
agent.default_model(orinline_assistant_model). Itsprovidermust equal the key underopenai_compatible, itsmodelmust be anavailable_modelsname of that provider, and the provider needs a key. Line the three up and supply the key. Issue #63878 on Zed (open, September 2026) reports the inline assistant showing this while the Agent Panel runs the identical provider and model fine. - No tools beside the model: that entry has
capabilities.toolsset tofalse. Flip it totruefor any build whose model page lists tool calls. - The UI will not edit the provider: per Zed issue #35461 (open), the LLM Providers page can change only a custom provider’s key. Edit the URL, ids and context windows in
settings.json. - Compaction or thread summaries fail on
reasoning_effort: when a model entry declaresreasoning_effort, Zed sends"reasoning_effort": "none"on those requests (Zed issue #60411, open, November 2026). Omit the field from these entries. - Two providers on one
api_urlshare a key: Zed stores keys per URL, so a second block aimed athttps://api.pentestllm.ai/v1with a different key prompts for it again and again (issue #41585). Use one provider block holding every id; a key restricted to certain models is a scope on that key, not a reason for a second provider.
Questions
Two places work: the LLM Providers page in Agent Settings, which saves it to the system keychain, or an environment variable named after the provider id in upper snake case with _API_KEY appended, which is PENTESTLLM_API_KEY for the block on this page. settings.json is never read for keys, and a set variable overrides the keychain.
Because agent.default_model (or inline_assistant_model) did not resolve to a configured provider holding a key. Its provider value has to equal the key under openai_compatible, its model has to be an available_models name of that provider, and a key has to exist in the keychain or the environment.
Yes. Under agent, each role has its own setting: commit_message_model, inline_assistant_model, thread_summary_model, compaction_model. All four accept the same { provider, model } object as default_model and inherit from it when unset. Most people put a fast build on commit messages and summaries and a strong one on the agent thread; the table above prices one agent turn on each. See the models page.
No. The selector shows exactly the ids under available_models, each with its max_tokens. When a new build lands on the models page, add its id and context window to the block to see it in Zed. The curl under Prove it outside Zed prints every id your key can reach.
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.