Documentation inconsistency: SDK Quick Start requires API key but Claude Code uses subscription auth

Resolved 💬 4 comments Opened Aug 16, 2025 by PabloLION Closed Nov 29, 2025

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: N/A - Documentation issue
  • Operating System: N/A - Documentation issue
  • Terminal: N/A - Documentation issue

Bug Description

The Claude Code SDK documentation at https://docs.anthropic.com/en/docs/claude-code/sdk#quick-start has a confusing inconsistency. The Quick Start section requires setting an ANTHROPIC_API_KEY environment variable in Step 2, but the example command in Step 3 doesn't actually use the API - it uses Claude Code's subscription-based authentication.

Steps to Reproduce

  1. Visit https://docs.anthropic.com/en/docs/claude-code/sdk#quick-start
  2. Follow the Quick Start guide
  3. Notice Step 2 requires setting: export ANTHROPIC_API_KEY="your-api-key-here"
  4. Notice Step 3's example doesn't use the API key: claude -p "Review this contract clause..."

Expected Behavior

The documentation should be consistent. Either:

  • Remove the API key setup step if Claude Code doesn't need it (since it uses subscription auth)
  • Explain why the API key is needed if there's a specific reason
  • Show an example that actually uses the API key

Actual Behavior

The documentation confusingly requires setting up an API key that appears unused in the example. Claude Code typically authenticates through the Claude Pro/Team subscription (browser login), not via API key.

Additional Context

This creates confusion for new users who may think they need an API key to use Claude Code, when in reality the CLI authenticates through their subscription. The example command shown (claude -p) is using the standard Claude Code CLI in non-interactive mode, not making API calls.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗