Claude Code setup guide
Install Claude Code, add your API key, and start a conversation through Starsg.
ImportantBefore you start, prepare an API Key created in the console. If you don't have one yet, follow the link to create it.
1. Environment check
If you use the npm commands below, first run node --version in a terminal. If the command is not found, visit the Node.js download page and install Node.js. Open a new terminal, then run both checks below.
node --version npm --version
Official installation guides: Claude Code
Install only the tool you want to use; skip any tool you already have. npm commands:
npm i -g @anthropic-ai/claude-code@latest
Important: run the --version command for the tool you installed to check the installation.
claude --version
A version number means the installation worked. If the command is not found, reopen your terminal and try again.
Important: if running claude reports it cannot reach the Anthropic service, follow Claude Code cannot connect to Anthropic to run the extra setup commands first, then come back and continue with the per-CLI configuration sections below.
2. Claude Code
Open ~/.claude/settings.json (create the file if it does not exist) and write:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.starsg.ai",
"ANTHROPIC_AUTH_TOKEN": "sk-abc...xyz",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-7",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5",
"CLAUDE_CODE_ATTRIBUTION_HEADER": "0",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"CLAUDE_CODE_DISABLE_TERMINAL_TITLE": "1"
}
}Replace sk-abc...xyz with a key created in the console.
Note: if you still hit errors after configuring and the CLI prompts you to log in, follow Claude Code cannot connect to Anthropic to resolve it.
3. Verify
Run claude in a terminal. A chat reply confirms the connection.