Integrations

Claude Code

Claude Code uses `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN` to connect to ApiHub. Use the root domain — no `/v1` suffix.

Last updated: 2026-08-03

Node.js is required. If not installed, set it up first. Node.js Setup
1

Install Claude Code

Install globally and verify the command works.

Terminal
npm install -g @anthropic-ai/claude-code
claude --version
3

Optional: project-level settings.json

Place this in your project's .claude/settings.json. It only affects that project and does not touch system env vars. Do not commit the file when it contains a Key.

.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://www.apihub.ink",
    "ANTHROPIC_AUTH_TOKEN": "your-apihub-key"
  }
}
4

Temporary setup (current terminal only)

Use this only to test connectivity. Variables are lost when the terminal closes.

Windows PowerShell
$env:ANTHROPIC_BASE_URL="https://www.apihub.ink"
$env:ANTHROPIC_AUTH_TOKEN="your-apihub-key"
claude
macOS / Linux
export ANTHROPIC_BASE_URL="https://www.apihub.ink"
export ANTHROPIC_AUTH_TOKEN="your-apihub-key"
claude
5

Verify

Navigate to any code project and run claude. Successful replies confirm the setup is complete.

Terminal
cd your-project
claude

Verification

  • Claude Code sends requests and returns model replies without 401/403 errors.

Common Errors

  • Using /v1 in the base URL breaks the Anthropic protocol path.
  • On Windows, not reopening the terminal after setting env vars — changes have not taken effect.