Skip to content

Qwen Code

Connect Qwen Code to HeyEly by adding an OpenAI-compatible provider entry in settings.json.

Qwen Code loads custom endpoints from the modelProviders block inside settings.json. Its openai provider speaks Chat Completions, so point baseUrl at the root https://heyely.si/v1 rather than a full endpoint path.

Set up

  1. Create a key in Developers and either export HEYELY_API_KEY in your shell or add HEYELY_API_KEY=sk-df-... to ~/.qwen/.env.
  2. Add the HeyEly provider configuration to ~/.qwen/settings.json (or %USERPROFILE%\.qwen\settings.json on Windows).
{
  "modelProviders": {
    "openai": [
      {
        "id": "anthropic/claude-sonnet-5.5",
        "name": "Claude Sonnet 5.5 (HeyEly)",
        "baseUrl": "https://heyely.si/v1",
        "envKey": "HEYELY_API_KEY",
        "generationConfig": {
          "contextWindowSize": 1000000,
          "samplingParams": { "max_tokens": 128000 }
        }
      }
    ]
  },
  "security": { "auth": { "selectedType": "openai" } },
  "model": { "name": "anthropic/claude-sonnet-5.5" }
}
  1. Launch qwen.

Avoid placing raw secrets inside settings.json's env block or passing --openai-api-key on the command line where they can leak into history or logs. Using envKey keeps the credential safely in your environment.

Verify

  1. Start a session and run /doctor to check auth and environment loading.
  2. Run /model to confirm your HeyEly model is listed.
  3. Fire off a quick CLI smoke test:
qwen -m anthropic/claude-sonnet-5.5 -p "Reply with exactly: gateway-ok"
  1. Check Credit and usage to see the request at the top of Spend under your selected model.

Pick a model

  • Select your active model via /model, -m, or model.name in settings.json.
  • Always nest token limits inside each entry's generationConfig; top-level model.generationConfig settings do not apply to custom providers.
  • Want to route an entry to POST /v1/responses instead of the default chat-completions? Add "wireApi": "responses" to that model object.
  • Updates to modelProviders take effect live without restarting Qwen Code.

Troubleshooting

You seeCauseFix
401 invalid_api_keyHEYELY_API_KEY is missing in Qwen Code's environmentExport it in the launch shell or save it in ~/.qwen/.env
Model missing from /modelWrong provider key or entry wrapped in an object instead of an arrayPlace entries directly in an array under modelProviders.openai
Qwen Code prompts for Qwen sign-inselectedType was not switchedSet security.auth.selectedType to "openai"
404baseUrl includes an extra path or omits /v1Set baseUrl to https://heyely.si/v1
404 model_not_foundid does not match HeyEly's catalogCopy the exact ID from the Models page