How to use Zed with a custom Anthropic or OpenAI-compatible endpoint
Add an anthropic_compatible provider to Zed with api_url https://www.ccsub.net, or openai_compatible with /api/v1, and set the key in the UI or CCSUB_API_KEY.
Copy-paste configuration
These are the three values the tool needs. Create the API key on the API Keys page of your CCSub dashboard.
- api_url (Anthropic-compatible)
https://www.ccsub.net(no /v1 — Zed adds /v1/messages)- api_url (OpenAI-compatible)
https://www.ccsub.net/api/v1- API Key
sk-your-ccsub-key(in the UI or as CCSUB_API_KEY)- name
claude-sonnet-5
"language_models": {
"anthropic_compatible": {
"ccsub": {
"api_url": "https://www.ccsub.net",
"available_models": [
{
"name": "claude-sonnet-5",
"display_name": "claude-sonnet-5 (CCSub)",
"max_tokens": 200000
}
]
}
}
}For model, use an ID such as claude-sonnet-5 — the full list of model IDs is on the models page. No key yet? Create an account first.
Steps at a glance
- 1
Create a CCSub API key
Sign up for CCSub and create an sk- key on the API Keys page of the dashboard.
- 2
Open settings.json
Run zed: open settings file from the command palette (Cmd+Alt+, on macOS).
- 3
Add an anthropic_compatible provider
Under language_models, add anthropic_compatible with a provider named ccsub, api_url https://www.ccsub.net, and the models you want in available_models, e.g. claude-sonnet-5.
- 4
Set the API key
Enter the key for ccsub under LLM Providers in Agent settings (agent: open settings), or set CCSUB_API_KEY and restart Zed.
- 5
Pick the model and verify
Open the Agent panel, choose the ccsub model, send a message, and check the Usage page in the CCSub dashboard.
Zed is an open-source code editor written in Rust, with an Agent panel built in. Unlike Cursor, Zed lets you configure an Anthropic-compatible provider directly, so claude- model IDs can go through CCSub too. Providers live in Zed's settings.json; the key is stored separately.
Opening settings.json
Open the command palette (Cmd+Shift+P on macOS, Ctrl+Shift+P elsewhere) and run zed: open settings file, or press Cmd+Alt+, on macOS. Plain Cmd+, opens the graphical Settings Editor; the provider configuration below is edited in the JSON file. It lives at ~/.config/zed/settings.json on macOS and Linux and %APPDATA%\Zed\settings.json on Windows.
Option 1: Anthropic-compatible (best for Claude model IDs)
Add a language_models block, or merge into the one you have:
{
"language_models": {
"anthropic_compatible": {
"ccsub": {
"api_url": "https://www.ccsub.net",
"available_models": [
{
"name": "claude-sonnet-5",
"display_name": "claude-sonnet-5 (CCSub)",
"max_tokens": 200000,
"capabilities": { "tools": true, "images": true }
}
]
}
}
}
}
- ccsub
- The provider name. Your choice, but it determines the environment variable name, so keep it lowercase.
- api_url
https://www.ccsub.netNo /v1 — Zed appends /v1/messages. No trailing slash.- name
claude-sonnet-5The model ID sent with each request.- display_name
- The label in the model picker.
- max_tokens
200000The context window Zed works with. Adjust as needed.- capabilities
- tools is on by default; images is off by default — set it to true to send screenshots.
The model field takes IDs such as claude-sonnet-5; the full list is on the models page. Add one entry to available_models per model you want in the picker.
Option 2: OpenAI-compatible
{
"language_models": {
"openai_compatible": {
"ccsub-openai": {
"api_url": "https://www.ccsub.net/api/v1",
"available_models": [
{ "name": "gpt-5.5", "display_name": "gpt-5.5 (CCSub)", "max_tokens": 200000 }
]
}
}
}
}
Note that the two api_url values follow opposite rules: Anthropic-compatible has no /v1 (Zed adds /v1/messages itself), while OpenAI-compatible goes all the way to /api/v1 (Zed only adds /chat/completions).
Setting the key
Zed's documentation is explicit: do not put API keys in settings.json. Use one of these instead:
- The UI. Run
agent: open settingsand find ccsub under LLM Providers, then paste your CCSub key. You can also create providers from Add Provider here — choose Anthropic for an Anthropic-compatible one. - An environment variable. The name is the provider name in upper snake case plus
_API_KEY:ccsubreadsCCSUB_API_KEY, andccsub-openaireadsCCSUB_OPENAI_API_KEY. Restart Zed after setting it.
Keep provider names lowercase with no spaces. Capital letters and spaces change the generated variable name, which is the usual cause of "I set the variable and nothing happened".
Verify
Open the Agent panel, choose a model under ccsub and send a message. Then look for the request on the Usage page of your CCSub dashboard. Comparing editors? See the Cursor guide, or the Cline guide if you prefer staying in VS Code.
Common errors and fixes
ccsub does not appear in the Agent model picker
Cause:settings.json has a JSON error (a missing or extra comma), or available_models is empty.
Fix:Zed highlights JSON errors when the file is open; fix them and list at least one model.
401 authentication_error: Missing or invalid API key
Cause:No key is set for ccsub, or the environment variable name does not match because the provider name has capitals or spaces.
Fix:Keep the provider name lowercase (ccsub → CCSUB_API_KEY), or paste the key in the Agent settings UI.
404 Not Found
Cause:The Anthropic-compatible api_url includes /v1, producing /v1/v1/messages, or it ends with a slash.
Fix:Use https://www.ccsub.net for Anthropic-compatible and https://www.ccsub.net/api/v1 for OpenAI-compatible, with no trailing slash.
For more error messages and what they mean, see the error troubleshooting index. Installation and network issues are covered in the troubleshooting docs (Chinese).
FAQ
Should the Anthropic-compatible api_url include /v1?
No. Zed appends /v1/messages, so use https://www.ccsub.net. OpenAI-compatible is the opposite: use https://www.ccsub.net/api/v1, because Zed only appends /chat/completions.
Can I put the key in settings.json?
Zed's docs say not to. Enter it in the Agent settings UI, or set an environment variable named after the provider in upper snake case plus _API_KEY — a provider called ccsub reads CCSUB_API_KEY.
Why are images ignored?
Models on compatible providers have image input off by default. Add capabilities to the model in available_models and set images to true.
What should max_tokens be?
In Zed, max_tokens is the context window the editor will use when assembling a request. The example uses 200000; adjust it to your needs. The per-response cap is a separate max_output_tokens field.
What goes in name?
The model ID sent with each request, such as claude-sonnet-5. The full list is on the CCSub models page.
Related setup guides
Need a CCSub API key?
Sign up, create a key in the dashboard, and paste the values above into your tool. Pay-as-you-go balance does not expire — you only pay for the tokens you use.