Skip to main content
Claude Code sends Anthropic-style requests. Use this guide only when your HiLinkup account and target Chinese model support Claude Messages-compatible calls.
A working OpenAI Chat Completions request does not prove that the Anthropic Messages route is available. Confirm the model and protocol in the HiLinkup console before configuring Claude Code.
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.
  1. Open the settings file:
  1. Paste:
  1. Save with Ctrl + O, press Enter, then exit with Ctrl + X.
  2. Start Claude Code:
This method stores the API key in a local config file. Do not screenshot, commit, or sync settings.json.

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.
Paste:
Add it to .gitignore:

Option 3: temporary environment variables

Use this for first-time verification when you do not want to modify config files.

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.
Create the helper script:
Paste:
Make it executable:
Edit ~/.claude/settings.json:
Paste:
Set the key before starting Claude Code:

Verify

1. Verify the HiLinkup Claude Messages route

2. Verify Claude Code

Send:

3. Verify the full agent path

Test in this order:
  1. Plain question without tools.
  2. Read the current directory structure.
  3. Read one non-sensitive file.
  4. Make one small change in a temporary branch or temporary directory.

Common issues

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.
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.
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.
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.
Last modified on August 12, 2026