agent-sdk-no-key
v1.0.0
Published
Proves the Claude Agent SDK works without an API key using your existing Claude Code subscription auth
Maintainers
Readme
Agent SDK without an API Key
Proves that the Claude Agent SDK works without ANTHROPIC_API_KEY when you're already logged into Claude Code via a Pro/Max subscription.
Try it
npx agent-sdk-no-keyExpected output
🔑 ANTHROPIC_API_KEY set: false
🚀 Spawning Agent SDK session...
⏱️ Session created in 0.0s
🔧 Init — model: claude-haiku-4-5-20251001, session: 6186c6d9-...
💬 Assistant: Hi there! 👋 How can I help you today?
✅ Result: Hi there! 👋 How can I help you today?
⏱️ Total: 2.7sInspiration
"We want to encourage local development and experimentation with the Agent SDK and claude -p. If you're building a business on top of the Agent SDK, you should use an API key instead. We'll make sure that's clearer in our docs."
Why this matters
The official docs say you need an API key from the Anthropic Console. In practice, the Agent SDK spawns the same Claude Code CLI under the hood, which picks up your existing subscription auth from ~/.claude/.
Prerequisites
- Node.js >= 20
- Logged into Claude Code (
claudeCLI) with a Pro or Max subscription
