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)
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.
Problem
Users integrating Claude Code Action with LLM Gateways, API proxies, or API management solutions currently need to use
env:blocks to setANTHROPIC_BASE_URLandANTHROPIC_CUSTOM_HEADERS. This is:Related Discussions (Users Currently Blocked)
Proposed Solution
Add native inputs that mirror the existing pattern for
anthropic_api_key:New Inputs
base_url""custom_headers""Backwards Compatibility
Inputs take precedence but fall back to env vars:
Use Cases
Implementation
Simple YAML changes to both
action.ymlfiles + documentation updates. No TypeScript changes needed - the SDK already reads these env vars.