Skip to main content

Claude Code

Prepare API Access​

Have the three items below ready before you configure anything:

API Key

The key string you generated when creating your API key.

Base URL

https://api.watt-cloud.com

Important: leave out the trailing /v1 — Claude Code appends /v1/messages automatically.

Note:

Claude Code talks to the Anthropic Messages API (/v1/messages). Only some Watt Cloud models support this endpoint; for models without support, use an OpenAI-compatible tool such as Codex or OpenCode.

Model Name

Take the complete model identifier from the Model Marketplace, for example GLM-5.1.

Installing Claude Code​

Get Claude Code from its official channels — see Claude Code.

Linux / macOS / WSL2​

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

npm offers an alternative route, with Node.js 22+ required:

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

Windows (PowerShell)​

irm https://claude.ai/install.ps1 | iex

Connect Claude Code to Watt Cloud​

Request routing is controlled through environment variables, or through ~/.claude/settings.json.

A previous sign-in with a Claude.ai account should be logged out first, to prevent the two auth methods from conflicting:

claude auth logout

Edit the Configuration File​

Open ~/.claude/settings.json, creating the file first if it does not exist:

{
"env": {
"ANTHROPIC_BASE_URL": "https://api.watt-cloud.com",
"ANTHROPIC_AUTH_TOKEN": "your-api-key",
"ANTHROPIC_MODEL": "GLM-5.1"
}
}

Field Reference​

FieldDescription
ANTHROPIC_BASE_URLHost of the API — do not append /v1
ANTHROPIC_AUTH_TOKENYour API key, transmitted as a Bearer token
ANTHROPIC_MODELModel identifier taken from the Model Marketplace

Note: Bearer authentication is what Watt Cloud applies to the Anthropic Messages API (/v1/messages), so ANTHROPIC_AUTH_TOKEN is the variable to set — not ANTHROPIC_API_KEY.

Set the API Key​

Nothing more than shell exports is needed for a quick test:

export ANTHROPIC_BASE_URL="https://api.watt-cloud.com"
export ANTHROPIC_AUTH_TOKEN="your-api-key"
export ANTHROPIC_MODEL="GLM-5.1"

Settings that should survive across sessions belong in the env block of ~/.claude/settings.json, matching the example above.

Change the Model​

Either update ANTHROPIC_MODEL inside ~/.claude/settings.json, or issue /model within the TUI.

Verify the Connection​

After the variables are in place, run:

claude -p "Reply with exactly one word: hello"

Getting hello back means the run succeeded. Inside the TUI, /status lets you confirm that Anthropic base URL reads https://api.watt-cloud.com.

Start Using the Model​

From your project directory, launch the interactive CLI:

claude