Claude Code

Set up Claude Code to use Modelway. You don’t need a Claude subscription.

Step 01

Get your Modelway key

Sign in, open API keys and click Create key. Copy it right away: it’s shown once. New to Modelway? Start with getting access.

Step 02

Install Claude Code

Open a terminal and run Anthropic’s installer:

shell
curl -fsSL https://claude.ai/install.sh | bash

With npm, if you already have Node.js 22:

shell
npm install -g @anthropic-ai/claude-code

Open a new terminal and check that it worked with claude --version, which prints a version number.

Step 03

Point it at Modelway

Claude Code reads ~/.claude/settings.json. Create the folder if it doesn’t exist yet, then open the file in an editor:

shell
1mkdir -p ~/.claude
2nano ~/.claude/settings.json

Paste this in, with your key in place of the placeholder:

~/.claude/settings.jsonjson
1{
2 "env": {
3 "ANTHROPIC_BASE_URL": "https://modelway.vip",
4 "ANTHROPIC_AUTH_TOKEN": "<your Modelway API key>",
5 "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1",
6 "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
7 "CLAUDE_CODE_AUTO_MODE_SERVER": "0"
8 }
9}

If the file already has settings, add these entries to its env block instead.

Step 04

Start Claude Code

Open a new terminal in a project folder and run:

shell
claude

It opens without asking you to log in. Switch models with /model.

Step 05

Use the VS Code extension (optional)

Run Preferences: Open User Settings (JSON) in VS Code and add:

settings.jsonjson
1{
2 "claudeCode.environmentVariables": [
3 {
4 "name": "ANTHROPIC_BASE_URL",
5 "value": "https://modelway.vip"
6 },
7 {
8 "name": "ANTHROPIC_AUTH_TOKEN",
9 "value": "<your Modelway API key>"
10 }
11 ]
12}

FAQ

Claude Code still asks me to log in.

Your key isn’t reaching it. Check that the file is at ~/.claude/settings.json, that it’s valid JSON and that ANTHROPIC_AUTH_TOKEN holds your key. If you were logged in to a Claude account before, run /logout so only the Modelway key is left.

How do I update?

The Modelway settings turn off Claude Code’s background traffic, and with it the automatic updates. Update by hand now and then with claude update.

How do I go back to my own Claude account?

Remove the Modelway entries from ~/.claude/settings.json and run claude again to log in.

How do I uninstall?

For the native install:

shell
1rm -f ~/.local/bin/claude
2rm -rf ~/.local/share/claude

Delete ~/.claude as well to remove your settings and history.