Examples use the HiLinkup platform model
aliyun/kimi-k3. This is a Chinese model example, not a requirement to use an overseas Claude model. Confirm available models with /v1/models and the console.Choose a configuration method
Option 1: user settings.json
Claude Code official settings use ~/.claude/settings.json for user-level settings. On Windows, ~/.claude resolves to %USERPROFILE%\.claude.
- macOS
- Linux
- Windows PowerShell
- Open the settings file:
- Paste:
-
Save with
Ctrl + O, press Enter, then exit withCtrl + X. - Start Claude Code:
Option 2: project-local settings
Use.claude/settings.local.json when only the current project should use HiLinkup. This file is for personal local settings and should not be committed.
- macOS / Linux
- Windows PowerShell
.gitignore:Option 3: temporary environment variables
Use this for first-time verification when you do not want to modify config files.- macOS / Linux
- Windows PowerShell
Option 4: read the key with apiKeyHelper
If your team uses 1Password, Vault, pass, Keychain, or an internal secret service, use a helper script so the key is not stored directly in JSON. Claude Code runs apiKeyHelper through the system shell and uses the command output as the request credential.
- macOS / Linux
- Windows PowerShell
Create the helper script:Paste:Make it executable:Edit Paste:Set the key before starting Claude Code:
~/.claude/settings.json:Verify
1. Verify the HiLinkup Claude Messages route
- macOS / Linux
- Windows PowerShell
2. Verify Claude Code
3. Verify the full agent path
Test in this order:- Plain question without tools.
- Read the current directory structure.
- Read one non-sensitive file.
- Make one small change in a temporary branch or temporary directory.
Common issues
Claude Code still uses the official Claude account
Claude Code still uses the official Claude account
Check that
ANTHROPIC_BASE_URL is available in the same terminal that starts claude. If a login session is still active but the custom gateway credential is missing, requests may not use the expected route.401 or 403
401 or 403
Confirm that you are using a HiLinkup API key and that the selected model supports Claude Messages-compatible calls. Do not mix an OpenAI key or Anthropic key with the HiLinkup base URL.
cURL works but Claude Code fails
cURL works but Claude Code fails
Claude Code agent requests include more context, tool definitions, and system fields. First verify a plain prompt, then gradually test file reads and shell commands.
Settings file does not apply
Settings file does not apply
User settings live in
~/.claude/settings.json; project settings live in .claude/settings.json; personal local project settings live in .claude/settings.local.json. On Windows, ~/.claude resolves to %USERPROFILE%\.claude. Restart Claude Code after model or base URL changes.