Claude Code — Best API Configuration Guide
Claude Code integration guide:
1. Install Node.js
Require Node.js v18.0.0 or above. Download from https://nodejs.org/en/download
2. Install Claude Code globally
bash
npm install -g @anthropic-ai/claude-code
# check version
claude --version3. Obtain API Key
Register on the site (e.g. https://api.morphogen.top), top up if needed, then copy your API key from the token management page. We recommend creating a token in the claude_cc group for lower cost.
4. Project configuration
1) Skip onboarding (optional)
Add "hasCompletedOnboarding": true to ~/.claude.json to skip login/onboarding.
2) Project-level settings
Create a .claude/settings.json in your project root and set your API key and model:
json
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.morphogen.top",
"ANTHROPIC_AUTH_TOKEN": "sk-xxxxx",
"ANTHROPIC_MODEL": "claude-sonnet-4-6",
"ANTHROPIC_SMALL_FAST_MODEL": "claude-haiku-4-5-20251001",
"CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": 1
}
}You can switch models via command:
bash
claude config set --global env '{"ANTHROPIC_MODEL": "claude-opus-4-6"}'Start Claude Code from project root:
bash
claude3) Global settings (optional)
Place settings.json in the user .claude folder (e.g., C:\Users\<user>\.claude on Windows or ~/.claude/settings.json on macOS/Linux).
5. Best practices
- Add
claude.mdin project root with project notes for Claude to read. - Monitor context size and use
/clearor/compactwhen needed.
6. Troubleshooting
- For
invalid beta flagor 400 errors, addCLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS:1. - To increase token limits, set
CLAUDE_CODE_MAX_OUTPUT_TOKENSin settings.