-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
dev-experienceenhancementNew feature or requestNew feature or requestfeature-requestp2Non-showstopper bug or popular feature requestNon-showstopper bug or popular feature request
Description
Problem
Users integrating Claude Code Action with LLM Gateways, API proxies, or API management solutions currently need to use env: blocks to set ANTHROPIC_BASE_URL and ANTHROPIC_CUSTOM_HEADERS. This is:
- Not discoverable - inputs don't appear in action.yml or IDE autocomplete
- Requires custom scripting - users must understand env var passthrough
- Confusing format - users don't know headers need JSON format (see AWS Bedrock via porkey in claude code action #704)
Related Discussions (Users Currently Blocked)
- AWS Bedrock via porkey in claude code action #704 - "AWS Bedrock via portkey" - User stuck with incorrect header format
- How to use portkey in claude code gh action? #575 - "How to use portkey in claude code gh action?" - No solution provided
- Connect claude-code-action with the LLM Gateway #272 - "Connect claude-code-action with the LLM Gateway" - Workaround via env blocks
- What to configure my own base url #551 - "What to configure my own base url" - Same pattern
Proposed Solution
Add native inputs that mirror the existing pattern for anthropic_api_key:
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
base_url: "https://your-gateway.example.com"
custom_headers: '{"x-portkey-api-key": "${{ secrets.PORTKEY_KEY }}"}'New Inputs
| Input | Description | Default |
|---|---|---|
base_url |
Custom API endpoint URL for LLM Gateway/proxy | "" |
custom_headers |
Custom HTTP headers as JSON string | "" |
Backwards Compatibility
Inputs take precedence but fall back to env vars:
ANTHROPIC_BASE_URL: ${{ inputs.base_url || env.ANTHROPIC_BASE_URL }}
ANTHROPIC_CUSTOM_HEADERS: ${{ inputs.custom_headers || env.ANTHROPIC_CUSTOM_HEADERS }}Use Cases
- LLM Gateways - Route through enterprise gateways per Anthropic docs
- Portkey/LiteLLM - Observability and fallback routing
- API Management - Azure APIM, AWS API Gateway, Kong policies
- Custom Auth - Subscription keys, bearer tokens, correlation IDs
Implementation
Simple YAML changes to both action.yml files + documentation updates. No TypeScript changes needed - the SDK already reads these env vars.
Metadata
Metadata
Assignees
Labels
dev-experienceenhancementNew feature or requestNew feature or requestfeature-requestp2Non-showstopper bug or popular feature requestNon-showstopper bug or popular feature request