Skip to main content

Claude Code setup (Grok 4.5)

Claude Code speaks Anthropic Messages. The gateway exposes POST /v1/messages so you can route traffic to your Grok group.
Claude Code appends /v1/messages to the base URL.
Use https://sub2api.lingshichat.top, not .../v1.
Including /v1 often produces /v1/v1/messages and 404.

1. Environment variables (fastest)

Windows PowerShell

macOS / Linux

Then:
Or, if supported:

2. ~/.claude/settings.json

Prefer storing only ANTHROPIC_BASE_URL in settings and injecting the token from the environment.

3. Verify

Some clients use x-api-key, others Authorization. Try both if one fails. In Claude Code:

Pitfalls

  1. Group must serve grok-4.5
  2. Use gateway model IDs, not Claude official names (unless you intend a Claude group)
  3. No extra path on base URL
    Correct: https://sub2api.lingshichat.top
    Wrong: .../v1 or .../claude

vs Grok Build

Prefer Grok Build for Grok 4.5 coding agents when you can; use Claude Code when your workflow already depends on it.

FAQ