How to Use Claude Code with Qwen 3.6 Plus Free on OpenRouter (2026 Complete Tutorial)

How to Use Claude Code with Qwen 3.6 Plus Free on OpenRouter (2026 Complete Tutorial)

7 min read
by Ufuk Ozen
Claude Code
Qwen 3.6 Plus
OpenRouter
Free AI Coding
Claude Code Tutorial
Qwen 3.6 Plus Free
Agentic Coding

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 -v to 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

  1. Visit https://openrouter.ai
  2. Click Sign Up and use GitHub or Google (takes 10 seconds)
  3. Navigate to Settings → API Keys in the dashboard
  4. Click Create Key and give it a recognizable name like "Claude Code"
  5. 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 IDProviderCost
qwen/qwen3.6-plus:freeOpenRouterFree
qwen/qwen3.6-plus-preview:freeOpenRouterFree

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.sh
1npm install -g @anthropic-ai/claude-code
BASH
UTF-8

Verify the installation succeeded:

example.sh
1claude --version
BASH
UTF-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:

  1. "Auth conflict: Both a token and an API key are set" -- Claude Code detects both ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN simultaneously.
  2. "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

  1. Run claude to enter the interactive session
  2. Type /logout to clear any stored Anthropic credentials
  3. Exit with /exit or Ctrl+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.sh
1ANTHROPIC_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" \ 8claude
BASH
UTF-8

What each environment variable does:

VariablePurpose
ANTHROPIC_BASE_URLRedirects API calls to OpenRouter instead of Anthropic
ANTHROPIC_AUTH_TOKENYour OpenRouter API key for authentication
ANTHROPIC_API_KEYMust be empty to prevent auth conflict
ANTHROPIC_MODELThe default model for all conversations
ANTHROPIC_DEFAULT_*_MODELPrevents internal fallbacks to Sonnet/Haiku/Opus from failing

Shorter Alternative (Minimum Required Variables)

If you just want to test quickly:

example.sh
1ANTHROPIC_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" \ 5claude
BASH
UTF-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
  • /refresh or /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.sh
1# For zsh (default on macOS) 2nano ~/.zshrc 3 4# For bash 5nano ~/.bashrc
BASH
UTF-8

Add this line at the bottom, replacing your API key:

example.sh
1alias 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'
BASH
UTF-8

Reload your shell:

example.sh
1source ~/.zshrc # or source ~/.bashrc
BASH
UTF-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"

  1. Run claude without any environment variables
  2. Type /logout inside the session
  3. Relaunch with the environment variable command from Step 4
  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:free or qwen/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:free variant, note that preview models come and go. The :free variant 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.

Building an AI-powered app?

Need help designing a secure, scalable backend for your AI project?

I help solo developers and small teams architect production-ready AI applications from day one.

consulting / freelance availabilityUsually replies within 24 hours.
Share:
Tags:
Claude Code
Qwen 3.6 Plus
OpenRouter
Free AI Coding
Claude Code Tutorial
Qwen 3.6 Plus Free
Agentic Coding