Zed
How to fix a wrong Zed API URL
The API URL is the root Zed uses to call AI Code With. The official OpenAI-compatible flow requires https://api.aicodewith.ai/v1. Zed appends the chat-completions path itself — do not drop /v1, and do not append /chat/completions.
Start with these checks
The API URL has the wrong path, is missing /v1, or you edited built-in OpenAI instead of openai_compatible.
- Sending a message fails, times out, or reports a wrong endpoint path, 404, or connection refused.
- The API URL is missing /v1, or was entered as https://api.aicodewith.ai
- Open Agent Settings → LLM Providers and confirm you selected the OpenAI-compatible AI Code With entry
404ECONNREFUSEDtimeout01
Confirm you edited openai_compatible, not built-in OpenAI
The correct path is Add Provider → OpenAI-compatible, then change only that new entry's API URL. Overwriting language_models.openai.api_url with a relay address replaces Zed's built-in OpenAI and can still authenticate against official OpenAI or scramble paths.
In Agent Settings → LLM Providers you should see a separate custom provider (for example AI Code With / aicodewith). If the list only shows built-in OpenAI, Anthropic, and similar, openai_compatible has not been added yet.
02
Enter the /v1 address with no extra path
The only correct value is https://api.aicodewith.ai/v1. Common mistakes: omitting /v1, using /v1/chat/completions, a trailing slash, or an old domain from another tutorial.
Zed treats the API URL as the OpenAI-compatible root. https://api.aicodewith.ai gets the next path appended without /v1; a full /chat/completions URL becomes a duplicated path. Both fail or 404.
- 1Open Agent Settings → LLM Providers and confirm you selected the OpenAI-compatible AI Code With entry
- 2Set the API URL to https://api.aicodewith.ai/v1 (keep /v1; add no further path)
03
Save and verify with a real request
Save the provider, pick a model under it in the Agent Panel, and send a message. On timeout or DNS errors, check that the machine can reach api.aicodewith.ai.
Success means a normal model reply and a matching AI Code With usage-record entry by time. A reply with no usage record means the request never hit AI Code With — see “Requests are not going to AI Code With”.
- 1Set the API URL to https://api.aicodewith.ai/v1 (keep /v1; add no further path)
- 2Do not edit language_models.openai.api_url; if you already did, restore the official value and use openai_compatible
Do not paste other relay domains from third-party tutorials (for example yibuapi.com) into Zed. This page only uses https://api.aicodewith.ai/v1.
If it is still not fixed
Sources
Reconfigure
Return to the integration center and continue the setup steps.
Return to the related setup step