Add support for ANTHROPIC_AUTH_TOKEN authentication#1009
Open
dceoy wants to merge 1 commit intoanthropics:mainfrom
Open
Add support for ANTHROPIC_AUTH_TOKEN authentication#1009dceoy wants to merge 1 commit intoanthropics:mainfrom
dceoy wants to merge 1 commit intoanthropics:mainfrom
Conversation
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
f7bfbfa to
46b866f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for a new
anthropic_auth_tokeninput parameter to enable authentication with third-party API providers like LiteLLM proxy, in addition to the existinganthropic_api_keyandclaude_code_oauth_tokenoptions.Key Changes
anthropic_auth_tokenin bothaction.ymlandbase-action/action.ymlfor third-party API provider authenticationANTHROPIC_AUTH_TOKENthrough to the action execution environmentvalidateEnvironmentVariables()to acceptANTHROPIC_AUTH_TOKENas a valid authentication method alongside existing optionsANTHROPIC_AUTH_TOKENis accepted as valid authenticationImplementation Details
The authentication validation now checks for any of three valid credentials in this order:
ANTHROPIC_API_KEY(direct Anthropic API)CLAUDE_CODE_OAUTH_TOKEN(OAuth token)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