Troubleshooting · Zed

Zed api_url for OpenAI-Compatible Models — Custom Base URL and the 404

How to point Zed's OpenAI provider at a custom endpoint with language_models.openai.api_url, and why a missing /v1 or an unlisted model id produces 404s.

What you see

zed custom openai api url

Why it happens

  • api_url was set without /v1. Zed appends the API path, such as /chat/completions, to api_url, so the request goes to a path the endpoint does not serve.
  • The api_url was added under the wrong settings key or with a typo, so Zed silently keeps using the default endpoint.
  • The endpoint is right but the model name in available_models is one it does not serve, which is the other source of 404s.

How to fix it

  • Set api_url to https://router.apitoken.sale/v1 and let Zed build the rest of the path.
  • Put the setting exactly at language_models.openai.api_url in settings.json — a misplaced key does not error, it just does nothing.
  • If the 404 body names a model, the path is fine and the model id is the problem: list the endpoint's models and use a served id.

Correct settings.json

{
  "language_models": {
    "openai": {
      "api_url": "https://router.apitoken.sale/v1"
    }
  }
}
// wrong: "api_url": "https://router.apitoken.sale"  → no /v1 in the path → 404

Related searches

  • zed api_url not working
  • {"error":{"message":"The requested endpoint is not supported.","type":"invalid_request_error","code":"unsupported_endpoint"}}

FAQ

Should the Zed api_url include /v1?+
Yes, for the OpenAI provider: https://router.apitoken.sale/v1. Zed appends the API path itself; without /v1 the path does not exist and the endpoint answers 404.
How do I know my custom api_url is actually in effect?+
Break it intentionally for one request (a nonsense host) — if nothing changes, Zed is not reading the key you edited; fix the settings path.
The path is right but I still get 404 — why?+
The 404 body names the missing thing. If it names a model, select an id the endpoint serves; list them via GET /v1/models.

Skip the broken setup

apiToken.sale serves GPT and Gemini models through OpenAI-compatible, Messages (Anthropic format) and native Gemini endpoints — standard SDKs, one key, one prepaid balance. Point your tool's base URL at it, and the config on this page works as written.