Skip to content

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

Description

@PabloLION

Environment

  • Platform (select one):
    • Anthropic API
    • AWS Bedrock
    • Google Vertex AI
    • Other:
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:authbugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions