How to Use Claude Code with Qwen 3.6 Plus Free on OpenRouter (2026 Complete Tutorial)
Step-by-step guide to run Claude Code completely free with Qwen 3.6 Plus Preview or Qwen 3.6 Plus using OpenRouter. Fix auth conflict, model not found error and start agentic coding today.
Qwen 3.6 Plus -- especially the :free and :preview:free tiers -- is currently one of the strongest free coding models available. It holds its own against much more expensive models on agentic coding benchmarks and costs zero dollars on OpenRouter as of April 2026.
In this comprehensive, step-by-step tutorial you will learn how to connect Claude Code (the powerful terminal-based AI coding agent) to Qwen 3.6 Plus Free using OpenRouter -- including how to fix the most common errors like "auth conflict" and "model may not exist."
Why Combine Claude Code with Qwen 3.6 Plus?
- 1 million token context window -- paste an entire codebase and still have room for the prompt
- Excellent agentic coding performance -- reads, edits, runs, and fixes in a production loop
- Completely free on OpenRouter -- no credit card, no billing surprise
- Terminal-native workflow -- works on macOS, Linux, and Windows WSL without a GUI
Prerequisites
Before we begin, make sure you have:
- Node.js v18 or higher -- run
node -vto check - A free OpenRouter account at https://openrouter.ai
- Basic terminal familiarity -- you will be typing a few commands
Step 1: Create Your Free OpenRouter Account and API Key
- Visit https://openrouter.ai
- Click Sign Up and use GitHub or Google (takes 10 seconds)
- Navigate to Settings → API Keys in the dashboard
- Click Create Key and give it a recognizable name like "Claude Code"
- Copy the key -- it starts with
sk-or-v1-...-- and save it somewhere safe
The two free Qwen 3.6 Plus model IDs you need to know:
| Model ID | Provider | Cost |
|---|---|---|
qwen/qwen3.6-plus:free | OpenRouter | Free |
qwen/qwen3.6-plus-preview:free | OpenRouter | Free |
You will paste the exact model ID in a moment. Do not guess it -- using the wrong string is the #1 reason people hit "model not found" errors.
Pro tip: Bookmark your API key page on OpenRouter. You will likely need it again if you set up aliases or CI pipelines later.
Step 2: Install Claude Code
Open your terminal and run the following command:
example.sh1npm install -g @anthropic-ai/claude-codeBASHUTF-8
Verify the installation succeeded:
example.sh1claude --versionBASHUTF-8
You should see the installed version number printed. If you get a "command not found" error, make sure your npm global binary directory is on your $PATH.
Step 3: Fix Auth Conflict and Model Errors (This Is Where Most People Get Stuck)
The two errors you will most likely encounter are:
- "Auth conflict: Both a token and an API key are set" -- Claude Code detects both
ANTHROPIC_API_KEYandANTHROPIC_AUTH_TOKENsimultaneously. - "There's an issue with the selected model (qwen/qwen3.6-plus:free)" -- Usually caused by a typo in the model ID or an unauthenticated session.
The fix is straightforward: log out first, then launch with environment variables.
Method A: Clear Existing Auth Inside Claude Code
- Run
claudeto enter the interactive session - Type
/logoutto clear any stored Anthropic credentials - Exit with
/exitorCtrl+D
This step is critical. Even if you pass fresh environment variables, a leftover session token inside ~/.claude/ will trigger the conflict error.
Step 4: Launch Claude Code with Qwen 3.6 Plus Free
Method B: One-Time Command Launch (Recommended for First-Time Users)
Navigate to your project folder and run the following command. Replace sk-or-v1-YOUR-KEY-HERE with your actual OpenRouter API key:
example.sh1ANTHROPIC_BASE_URL="https://openrouter.ai/api" \ 2ANTHROPIC_AUTH_TOKEN="sk-or-v1-YOUR-KEY-HERE" \ 3ANTHROPIC_API_KEY="" \ 4ANTHROPIC_MODEL="qwen/qwen3.6-plus-preview:free" \ 5ANTHROPIC_DEFAULT_HAIKU_MODEL="qwen/qwen3.6-plus-preview:free" \ 6ANTHROPIC_DEFAULT_SONNET_MODEL="qwen/qwen3.6-plus-preview:free" \ 7ANTHROPIC_DEFAULT_OPUS_MODEL="qwen/qwen3.6-plus-preview:free" \ 8claudeBASHUTF-8
What each environment variable does:
| Variable | Purpose |
|---|---|
ANTHROPIC_BASE_URL | Redirects API calls to OpenRouter instead of Anthropic |
ANTHROPIC_AUTH_TOKEN | Your OpenRouter API key for authentication |
ANTHROPIC_API_KEY | Must be empty to prevent auth conflict |
ANTHROPIC_MODEL | The default model for all conversations |
ANTHROPIC_DEFAULT_*_MODEL | Prevents internal fallbacks to Sonnet/Haiku/Opus from failing |
Shorter Alternative (Minimum Required Variables)
If you just want to test quickly:
example.sh1ANTHROPIC_BASE_URL="https://openrouter.ai/api" \ 2ANTHROPIC_AUTH_TOKEN="sk-or-v1-YOUR-KEY-HERE" \ 3ANTHROPIC_API_KEY="" \ 4ANTHROPIC_MODEL="qwen/qwen3.6-plus:free" \ 5claudeBASHUTF-8
The longer version above is more reliable because it prevents internal model substitution errors when Claude Code tries to fall back to a specific tier model.
Step 5: Inside Claude Code -- Essential Commands
Once Claude Code launches and you are inside the interactive session:
/status-- Confirms your connection is alive and shows current configuration/model-- Lists available models; verify you are on Qwen 3.6 Plus/model qwen/qwen3.6-plus-preview:free-- Manually switch models mid-session/refreshor/models-- Reload the model list from OpenRouter
Now you are ready. Type a project prompt like:
"Create a FastAPI todo application with SQLite and add Docker support"
Claude Code will read your project directory, plan the implementation, create files, and iterate -- all from the terminal.
Step 6: Make It Permanent with a Shell Alias
Typing twenty environment variables every time is tedious. The cleanest approach is a shell alias.
Open your shell configuration file:
example.sh1# For zsh (default on macOS) 2nano ~/.zshrc 3 4# For bash 5nano ~/.bashrcBASHUTF-8
Add this line at the bottom, replacing your API key:
example.sh1alias qwenclaude='ANTHROPIC_BASE_URL="https://openrouter.ai/api" ANTHROPIC_AUTH_TOKEN="sk-or-v1-YOUR-KEY" ANTHROPIC_API_KEY="" ANTHROPIC_MODEL="qwen/qwen3.6-plus-preview:free" claude'BASHUTF-8
Reload your shell:
example.sh1source ~/.zshrc # or source ~/.bashrcBASHUTF-8
From now on, just type qwenclaude in any directory and you are in.
Troubleshooting Common Errors
"Auth conflict: Both a token and an API key are set"
- Run
claudewithout any environment variables - Type
/logoutinside the session - Relaunch with the environment variable command from Step 4
- Ensure
ANTHROPIC_API_KEY=""is explicitly empty, not unset
"Model not found" or "Model may not exist"
- Double-check the exact model ID. It must be
qwen/qwen3.6-plus-preview:freeorqwen/qwen3.6-plus:free-- no variations. - Visit OpenRouter's model page and search "Qwen" to confirm the model is listed.
- If you are using the
:preview:freevariant, note that preview models come and go. The:freevariant is typically more stable.
Rate limiting or "Too many requests"
- Free tiers on OpenRouter have stricter rate limits than paid ones.
- Wait 60--120 seconds and retry.
- If you hit it repeatedly, create a new API key on OpenRouter or check their status page for free-tier restrictions.
Claude Code crashes or hangs on launch
- Delete the local Claude Code cache:
rm -rf ~/.claude - Reinstall:
npm uninstall -g @anthropic-ai/claude-code && npm install -g @anthropic-ai/claude-code - Ensure Node.js is v18 or higher:
node -v
Final Tips for Maximum Performance
Always prefer qwen/qwen3.6-plus-preview:free -- the preview variant is typically the most up-to-date build and performs marginally better on coding tasks.
Give broad project context in your opening message -- instead of "fix this bug," paste the relevant file and describe the expected behavior. The 1M token context window means you can share a surprising amount of code.
Accept the permissions -- Claude Code asks for Read, Edit, Write, and Bash access. Grant all of them; the agentic loop depends on being able to create and modify files autonomously.
Combine with other tools -- if you also use Cursor, Continue.dev, or similar IDEs, you can point them to the same OpenRouter endpoint for a unified, free coding model across your entire workflow.
Summary
Qwen 3.6 Plus Free on OpenRouter paired with Claude Code is, as of April 2026, the best zero-cost agentic coding setup available. No GPU required, no local model to download -- just a terminal, an OpenRouter key, and your project folder.
The entire setup takes under ten minutes and gives you a powerful AI development partner that reads, writes, and debugs code iteratively from the command line.
Did this tutorial help you? Drop your results, project ideas, or any remaining errors in the comments below.



