Skip to content

fix: use ANTHROPIC_AUTH_TOKEN to prevent login prompt#2

Merged
1bcMax merged 1 commit intoBlockRunAI:mainfrom
0xCheetah1:fix/auth-token-env-var
Mar 26, 2026
Merged

fix: use ANTHROPIC_AUTH_TOKEN to prevent login prompt#2
1bcMax merged 1 commit intoBlockRunAI:mainfrom
0xCheetah1:fix/auth-token-env-var

Conversation

@0xCheetah1
Copy link
Contributor

Summary

  • Replace ANTHROPIC_API_KEY with ANTHROPIC_AUTH_TOKEN when spawning Claude Code in start.ts
  • Claude Code checks ANTHROPIC_AUTH_TOKEN to determine if the user is authenticated, not ANTHROPIC_API_KEY
  • Without this, Claude Code ignores the API key and shows a login prompt even though the proxy is running correctly

Problem

Running brcc start --model <model> would spawn Claude Code but it would prompt for login, even though:

  • The proxy was running on the correct port
  • Curl tests confirmed the endpoint worked

This happened because the previous code set ANTHROPIC_API_KEY which Claude Code ignores for auth detection.

Fix

Set ANTHROPIC_AUTH_TOKEN to a placeholder value (x402-proxy-handles-auth) since the proxy handles real authentication via x402/wallet signature:

env: {
  ...cleanEnv,
  ANTHROPIC_BASE_URL: `http://localhost:${port}/api`,
  ANTHROPIC_AUTH_TOKEN: 'x402-proxy-handles-auth',
  ANTHROPIC_DEFAULT_SONNET_MODEL: sonnetModel,
  ...
}

Test plan

  • Run brcc start --model nvidia/nemotron-ultra-253b
  • Confirm no login prompt appears and proxy routes correctly

… login prompt

Claude Code checks ANTHROPIC_AUTH_TOKEN to determine if the user is
authenticated. Previously we were setting ANTHROPIC_API_KEY which
Claude Code ignores, causing it to show a login prompt even though
the proxy was running correctly.

Now setting ANTHROPIC_AUTH_TOKEN to a placeholder value since the
proxy handles authentication via x402/wallet signature.
@1bcMax 1bcMax merged commit 4307766 into BlockRunAI:main Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants