Anthropic-specific authentication via claude setup-token.
Summary
Functions
Returns the environment variable name for Claude OAuth tokens.
Guides user through obtaining an OAuth token via claude setup-token.
Functions
@spec oauth_env_var() :: String.t()
Returns the environment variable name for Claude OAuth tokens.
Examples
iex> ClaudeAgentSDK.Auth.Providers.Anthropic.oauth_env_var()
"CLAUDE_AGENT_OAUTH_TOKEN"
@spec setup_token() :: {:ok, String.t(), DateTime.t()} | {:error, term()}
Guides user through obtaining an OAuth token via claude setup-token.
The Claude CLI requires an interactive TTY, so this function prompts
the user to run claude setup-token in a separate terminal and paste
the resulting token.
Requirements
- Claude Code CLI installed (v2.0.10+)
- Active Claude subscription
Token Format
Accepts OAuth tokens (sk-ant-oat01-...) or API keys (sk-ant-api03-...).