Skip to content

Hand Claude Code a gateway token, not an API key - #185

Open
vitramir wants to merge 1 commit into
mainfrom
claude-gateway-auth-token
Open

Hand Claude Code a gateway token, not an API key#185
vitramir wants to merge 1 commit into
mainfrom
claude-gateway-auth-token

Conversation

@vitramir

@vitramir vitramir commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Platform-mode workloads stop on first run with:

Detected a custom API key in your environment
  ANTHROPIC_API_KEY: sk-ant-...platform
  Do you want to use this API key?

agynd writes that variable into ~/.claude/settings.json to satisfy the CLI's demand for a credential. But an API key is consent-gated: the CLI records approvals in customApiKeyResponses and blocks until someone answers — and in a workload nobody is there to. Suppressing one prompt bought another.

ANTHROPIC_AUTH_TOKEN satisfies the same requirement (ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, CLAUDE_CODE_OAUTH_TOKEN, or WIF env vars required) and is the variable meant for a gateway in front of the vendor — the CLI refers to it as "the gateway token provided via ANTHROPIC_AUTH_TOKEN". Only ANTHROPIC_API_KEY is consent-gated.

The value is unused either way: the LLM Proxy authorizes the workload's OpenZiti identity, not a header. Native mode is unaffected — it sets neither.

An API key is consent-gated: the CLI stops and asks whether to trust the
key it found in its environment, which in a workload nobody is there to
answer. ANTHROPIC_AUTH_TOKEN is the variable meant for a proxy standing
in front of the vendor and carries no such prompt.

The value is unused either way. The proxy authorizes the workload's
OpenZiti identity, not anything sent in a header.
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.

1 participant