Qwen Code
Connect Qwen Code to GonkaGate with the official qwen-code-setup installer.
Connect an existing Qwen Code install to GonkaGate with the official installer. This guide uses the supported @gonkagate/qwen-code-setup path, so you do not have to hand-edit Qwen settings, export keys through shell profiles, or store secrets in a repository.
Quick setup with the official installer
Run the official installer:
npx @gonkagate/qwen-code-setupThis tool configures an existing local qwen install. It does not install Qwen Code itself.
Use it if you want the safe default setup without hand-editing Qwen Code config:
- keeps the secret out of repository-local files
- preserves unrelated Qwen settings instead of rewriting whole files
- checks GonkaGate
/v1/modelsbefore writing config - writes the supported GonkaGate models into Qwen Code’s OpenAI-compatible provider catalog
- verifies the durable local setup before returning you to plain
qwen
Before you start
- Qwen Code is already installed locally and available as
qwenonPATH. - The audited Qwen Code baseline is
@qwen-code/qwen-code0.18.0. - Node
>=22.14.0is available for thenpxinstaller. - You already have a GonkaGate API key in
gp-...format. - The installer currently starts with
qwen/qwen3-235b-a22b-instruct-2507-fp8.
Choose the right scope
The installer supports two scopes:
user: use GonkaGate on this machine in general.project: make GonkaGate the default for the current repository.
Project scope keeps secrets out of repository files. The installer writes the GonkaGate provider catalog and GONKAGATE_API_KEY into the active user Qwen settings, then writes only activation settings into project Qwen settings.
One limit matters here: project modelProviders can hide user-managed providers in the audited Qwen Code baseline. If a trusted project already defines modelProviders, the installer blocks instead of writing a setup that would look correct but fail at runtime.
Non-interactive setup
Use this for scripts, automation, or repeatable local setup:
npx @gonkagate/qwen-code-setup --scope user --yesWith a key from the environment:
GONKAGATE_API_KEY="$GONKAGATE_API_KEY" npx @gonkagate/qwen-code-setup --scope project --yesWith a key through stdin and JSON output:
printf '%s' "$GONKAGATE_API_KEY" | npx @gonkagate/qwen-code-setup --api-key-stdin --scope project --yes --jsonUse dry run when you want to inspect planned writes first:
npx @gonkagate/qwen-code-setup --scope user --dry-runPass the key only through:
- the hidden interactive prompt
GONKAGATE_API_KEY--api-key-stdin
The installer intentionally does not accept plain --api-key, so secrets do not end up in shell history or process lists.
Verify the setup
If Qwen Code is already open, close it first. Then start a fresh session:
qwenThen:
- confirm the active model is a GonkaGate model
- switch models in Qwen Code if needed
- send this prompt:
Reply with exactly: Qwen Code connected to GonkaGate
That confirms the provider, model selection, and request path before a longer coding session.
The installer verifies durable local settings by default. If you explicitly want a live model call during setup, use --verify-live. That can spend quota and depends on current provider and network availability, so it is not part of the default success check.
Where qwen-code-setup writes data
The installer keeps secrets out of the repository. It manages these Qwen Code surfaces:
- user settings:
~/.qwen/settings.json QWEN_HOMEuser settings:<QWEN_HOME>/settings.json- project activation settings:
.qwen/settings.json - backups:
~/.gonkagate/qwen-code/backups/ - install state:
~/.gonkagate/qwen-code/install-state.json
The managed Qwen settings use:
modelProviders.openai[]for GonkaGate modelssecurity.auth.selectedType = "openai"model.namefor the selected GonkaGate modelsettings.env.GONKAGATE_API_KEYfor the durable key
The provider catalog includes all currently supported GonkaGate models for this setup flow:
qwen/qwen3-235b-a22b-instruct-2507-fp8moonshotai/Kimi-K2.6minimaxai/minimax-m2.7
Common first failures
| If you see | What it usually means | What to do |
|---|---|---|
qwen_not_found | Qwen Code is missing or not on PATH | Install @qwen-code/qwen-code, then rerun the installer |
qwen_version_unsupported | The local Qwen Code version does not match the audited setup contract | Use the supported baseline or rerun the compatibility audit before changing setup assumptions |
secret_missing | No safe GonkaGate key source was provided | Use the hidden prompt, GONKAGATE_API_KEY, or --api-key-stdin |
required_models_unavailable | GonkaGate /v1/models did not return every required model for this key | Recheck the key and model access, then retry |
project_modelproviders_override | Trusted project settings define modelProviders and would hide the user provider set | Remove the project override or use user scope |
secret_shadowed_by_process_env | The current shell has a different GONKAGATE_API_KEY | Unset or align the current environment value before starting qwen |
secret_shadowed_by_project_env | A trusted project .qwen/.env or .env overrides the managed user key | Remove or align the project env value |
live_verify_failed after --verify-live | Local config can be correct while the live request fails for quota, model, or network | Check balance, quota, selected model, and provider availability before retrying live verification |
Current limits
- This guide configures an existing Qwen Code install. It does not install Qwen Code itself.
- The audited Qwen Code baseline is
@qwen-code/qwen-code0.18.0. - The current transport target is OpenAI-compatible
chat/completionsthroughhttps://api.gonkagate.com/v1. - The installer writes all three supported models into
modelProviders.openai[], then selects one throughmodel.name. - The installer does not accept arbitrary custom base URLs.
- The installer does not accept arbitrary raw model IDs.
- The installer does not accept plain
--api-key. - The installer does not mutate shell profiles or store secrets in repository-local files.
- Default setup success is based on local verification, not a live model call.
Official references
- GonkaGate Qwen Code installer
- Qwen Code installer security notes
- Qwen Code installer model validation
- Qwen Code installer troubleshooting
See also
- Claude Code for the supported Anthropic-compatible path
- Cursor setup for Cursor’s OpenAI settings path
- Kilo Code for the Kilo Code installer path
- MiMoCode for the MiMoCode installer path
- OpenCode setup for the OpenCode installer path
- OpenClaw setup for the custom-provider route
- Hermes Agent for the Hermes installer path
- Authentication and API Keys for key creation, storage, and rotation
- Get Models for current machine-readable model IDs