Zed OpenAI-compatible provider: a security-tuned model in the Agent Panel

The openai_compatible block for Zed’s settings.json: api_url, security or uncensored ids with max_tokens and capabilities, the key in keychain or env var.

Steps checked November 2, 2026 · prices as of November 17, 2026

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

  1. Paste the block below into settings.json. Every entry under available_models must carry max_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_model makes the first entry the model for new threads:
settings.json
1{
2 "language_models": {
3 "openai_compatible": {
4 "pentestllm": {
5 "api_url": "https://api.pentestllm.ai/v1",
6 "available_models": [
7 {
8 "name": "deepseek-v4.1-flash-1017-uncensored",
9 "display_name": "DeepSeek V4.1 Flash 1017 Uncensored",
10 "max_tokens": 1048576,
11 "capabilities": { "tools": true, "images": false, "parallel_tool_calls": false, "prompt_cache_key": false }
12 },
13 {
14 "name": "glm-5.3-flash-apex-abliterated",
15 "display_name": "GLM-5.3 Flash Apex Abliterated",
16 "max_tokens": 1048576,
17 "capabilities": { "tools": true, "images": false, "parallel_tool_calls": false, "prompt_cache_key": false }
18 },
19 {
20 "name": "kimi-k3-uncensored",
21 "display_name": "Kimi K3 Uncensored",
22 "max_tokens": 262144,
23 "max_output_tokens": 65536,
24 "capabilities": { "tools": true, "images": true, "parallel_tool_calls": false, "prompt_cache_key": false }
25 }
26 ]
27 }
28 }
29 },
30 "agent": {
31 "default_model": {
32 "provider": "pentestllm",
33 "model": "deepseek-v4.1-flash-1017-uncensored"
34 }
35 }
36}
  1. 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:
shell
1export PENTESTLLM_API_KEY="sk-ptl-live-…"
  1. 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 to agent.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 id
shown 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/v1
the request destination; keep the trailing /v1 and add nothing after it
available_models[].name
deepseek-v4.1-flash-1017-uncensored
the 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 picker
optional; the raw id appears when it is absent
available_models[].max_tokens
the context window
required; by default Zed compacts a thread at 90% of this number, so use the catalog’s figure
available_models[].max_output_tokens
the output limit
optional; 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- key
the 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.

ModelOne agent turnTool calls
GLM-5.3 Uncensored$0.01model page
GLM-5.3 Flash Uncensored$0.0047model page
DeepSeek V4.1 Flash Abliterated$0.04model page
DeepSeek V4 Pro Uncensored$0.04model page
GLM-5.3 Abliterated$0.09model page
GLM-5.3 Flash Code Uncensored$0.25model page
DeepSeek V4.1 Flash 1017 Uncensored$0.04model page
GLM-5.3 Flash Apex Abliterated$0.04model page
Kimi K3 Uncensored$0.26model page

Priced at 40,000 input tokens and 1,200 output tokens, catalog prices on 2026-11-17. Tool support is as the catalog publishes it; where it is silent, the model page has the answer.

Uncensored models and their prices per million tokens
GLM-5.3 Uncensoredglm-5.3-uncensoredUncensored$0.282$0.846
GLM-5.3 Flash Uncensoredglm-5.3-flash-uncensoredUncensored$0.1053$0.3685
DeepSeek V4.1 Flash Abliterateddeepseek-v4.1-flash-abliteratedAbliterated$0.8488$1.6975
DeepSeek V4 Pro Uncensoreddeepseek-v4-pro-uncensoredUncensored$0.97$1.94
GLM-5.3 Abliteratedglm-5.3-abliteratedAbliterated$2.1825$4.365
GLM-5.3 Flash Code Uncensoredglm-5.3-flash-code-uncensoredUncensored$6.00$6.00
DeepSeek V4.1 Flash 1017 Uncensoreddeepseek-v4.1-flash-1017-uncensoredUncensored$0.8003$3.201
GLM-5.3 Flash Apex Abliteratedglm-5.3-flash-apex-abliteratedAbliterated$0.80$3.20
Kimi K3 Uncensoredkimi-k3-uncensoredUncensored$5.745$28.68

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

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:

shell
1curl 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.

shell
1curl -i https://api.pentestllm.ai/v1/chat/completions \
2 -H "Authorization: Bearer sk-ptl-live-…" \
3 -H "Content-Type: application/json" \
4 -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 stale PENTESTLLM_API_KEY in 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 your available_models entries has a name that is not a real id. Compare the spelling, and remember the id goes in name, not display_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 the retry-after the response names.
  • LLM provider is not configured or does not support the configured model: Zed could not resolve agent.default_model (or inline_assistant_model). Its provider must equal the key under openai_compatible, its model must be an available_models name 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.tools set to false. Flip it to true for 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 declares reasoning_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_url share a key: Zed stores keys per URL, so a second block aimed at https://api.pentestllm.ai/v1 with 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.

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