Skip to content

claude_code_oauth_token (sk-ant-oat01-*) fails with Header 14 invalid value #1316

@7da11

Description

@7da11

Bug Description

When using claude_code_oauth_token with a token generated by claude setup-token (prefix sk-ant-oat01-*), the action fails with:

API Error: Header '14' has invalid value: '***'

The same token works correctly when used locally with claude -p.

Steps to Reproduce

  1. Generate OAuth token: claude setup-token (Max 5x plan, sk-ant-oat01-* format)
  2. Store as GitHub secret CLAUDE_CODE_OAUTH_TOKEN
  3. Configure workflow with claude_code_oauth_token parameter
  4. Trigger via @claude comment on a PR

Observed Behavior

The OIDC and app token exchange succeed, but Claude Code SDK fails:

OIDC token successfully obtained
App token successfully obtained
...
SDK execution error: Error: Claude Code returned an error result: API Error: Header '14' has invalid value

Also Tried

  • Passing the same OAuth token via anthropic_api_key parameter: Invalid API key error (expected, different code path)
  • Token works locally: ANTHROPIC_API_KEY=sk-ant-oat01-... claude -p "echo test" succeeds

Environment

  • Plan: Max 5x
  • Auth method: claude.ai (OAuth)
  • Action version: v1 (SHA: 51ea8ea)
  • Runner: ubuntu-latest (Ubuntu 24.04)
  • Workflow permissions include id-token: write
  • claude auth status locally shows: loggedIn: true, authMethod: claude.ai, subscriptionType: max

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp2Non-showstopper bug or popular feature requestprovider:1pAnthropic First-Party API

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions