Claude Code CLI


Connect Claude Code CLI to iCreat from the terminal

Claude Code CLI is Anthropic's terminal AI coding assistant. It reads your codebase, edits files, and runs commands. With iCreat, you can route claude commands to the iCreat API without an official Anthropic account.

For the Claude Desktop Code graphical interface, see Claude Code.

Before you start

  • An API Key created on iCreat (replace <sk-your-token> below with your key)
  • Network access to https://api.icreat.ai
  • Node.js 18+ if you install via npm

Install

macOS / Linux / WSL

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

Or via npm:

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

Windows (PowerShell, run as Administrator)

irm https://claude.ai/install.ps1 | iex
# or
npm install -g @anthropic-ai/claude-code

Verify installation:

claude --version

Write the config file

The CLI reads the iCreat endpoint from ~/.claude/settings.json (or shell environment variables).

macOS / Linux~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.icreat.ai/v1/llm",
    "ANTHROPIC_AUTH_TOKEN": "<sk-your-token>",
    "CLAUDE_CODE_ATTRIBUTION_HEADER": "0"
  }
}

Windows%USERPROFILE%\.claude\settings.json (same JSON):

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.icreat.ai/v1/llm",
    "ANTHROPIC_AUTH_TOKEN": "<sk-your-token>",
    "CLAUDE_CODE_ATTRIBUTION_HEADER": "0"
  }
}

Windows users

If the .claude directory does not exist, run this first:

mkdir "%USERPROFILE%\.claude"

Launch and verify

Start from your project directory:

cd your-project-folder
claude

On first launch, you may be prompted to: choose a theme → confirm the safety notice → trust the working directory.

To verify:

  • Enter in chat: Reply with "Claude Code is connected to iCreat!" using your default model.
  • Or run /status and confirm Anthropic base URL is https://api.icreat.ai/v1/llm and Auth token shows ANTHROPIC_AUTH_TOKEN is active

Configuration reference

Variable Description
ANTHROPIC_BASE_URL iCreat API base URL: https://api.icreat.ai/v1/llm (Claude Code appends paths such as /v1/messages)
ANTHROPIC_AUTH_TOKEN Your iCreat API Key, sent as a Bearer token. Use this for third-party gateways, not ANTHROPIC_API_KEY
CLAUDE_CODE_ATTRIBUTION_HEADER Set to "0" to disable the attribution header (recommended for CLI)

Desktop vs CLI

In the desktop gateway UI, Gateway base URL and Gateway API key are equivalent to ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN (Bearer mode). See Claude Code for desktop setup.

Optional: CC-Switch

If you use Claude Code, Codex, Gemini CLI, and other tools together, CC-Switch lets you switch iCreat and other providers from a GUI. See the CC-Switch setup guide.

FAQ

Can the desktop app and CLI share the same config?

Some settings (permission rules, MCP, and others) are shared via ~/.claude/settings.json, but the desktop app must configure API routing separately under Developer → Configure Third-Party Inference. It does not automatically read CLI ANTHROPIC_BASE_URL. For desktop setup, see Claude Code.

Login prompts or 401 connection errors?

  • Confirm your API Key is valid and its group includes the models you need
  • Check ANTHROPIC_AUTH_TOKEN spelling and the ~/.claude/settings.json path

"Gateway was unreachable"?

curl -I https://api.icreat.ai
# Should return HTTP 200