Skip to content

Add support for ANTHROPIC_AUTH_TOKEN authentication#1009

Open
dceoy wants to merge 1 commit intoanthropics:mainfrom
dceoy:claude/add-anthropic-auth-token-oCF4M
Open

Add support for ANTHROPIC_AUTH_TOKEN authentication#1009
dceoy wants to merge 1 commit intoanthropics:mainfrom
dceoy:claude/add-anthropic-auth-token-oCF4M

Conversation

@dceoy
Copy link

@dceoy dceoy commented Mar 4, 2026

Summary

This PR adds support for a new anthropic_auth_token input parameter to enable authentication with third-party API providers like LiteLLM proxy, in addition to the existing anthropic_api_key and claude_code_oauth_token options.

Key Changes

  • Added new input parameter: anthropic_auth_token in both action.yml and base-action/action.yml for third-party API provider authentication
  • Updated environment variable handling: Pass ANTHROPIC_AUTH_TOKEN through to the action execution environment
  • Enhanced validation logic: Modified validateEnvironmentVariables() to accept ANTHROPIC_AUTH_TOKEN as a valid authentication method alongside existing options
  • Updated error messaging: Changed validation error message to reflect all three supported authentication methods
  • Added test coverage: New test case verifying ANTHROPIC_AUTH_TOKEN is accepted as valid authentication
  • Documentation updates: Minor formatting fixes in README and documentation files (removed extra blank lines for consistency)

Implementation Details

The authentication validation now checks for any of three valid credentials in this order:

  1. ANTHROPIC_API_KEY (direct Anthropic API)
  2. CLAUDE_CODE_OAUTH_TOKEN (OAuth token)
  3. ANTHROPIC_AUTH_TOKEN (third-party providers)

This maintains backward compatibility while enabling new integration scenarios with proxy services and alternative API providers.

https://claude.ai/code/session_01Q7hAv9Ah5eeZjXPEqmhYoW

Add anthropic_auth_token input to both action.yml and base-action/action.yml,
pass it as ANTHROPIC_AUTH_TOKEN env var to Claude Code, and update validation
to accept it as an alternative to ANTHROPIC_API_KEY/CLAUDE_CODE_OAUTH_TOKEN.
This enables use with proxy servers like LiteLLM.

https://claude.ai/code/session_01Q7hAv9Ah5eeZjXPEqmhYoW
@dceoy dceoy marked this pull request as draft March 5, 2026 02:28
@dceoy dceoy force-pushed the claude/add-anthropic-auth-token-oCF4M branch from f7bfbfa to 46b866f Compare March 5, 2026 02:41
@dceoy dceoy marked this pull request as ready for review March 5, 2026 02:42
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