Connection Methods
API Key
Direct API access with a key from the Anthropic Console
Claude Max/Pro OAuth
One-click sign-in with your Claude subscription
API Key Setup
Get your API key
- Go to the Anthropic Console
- Navigate to API Keys
- Click Create Key
- Copy your API key (starts with
sk-ant-)
Keep your API key secure. Never commit it to version control or share it publicly.
Add connection in Craft Agents
- Open Settings → AI Connections
- Click Add Connection
- Select Anthropic (API Key)
- Paste your API key
- Choose your default model (e.g.,
claude-sonnet-4.6) - Click Save
Available Models
Craft Agents automatically detects the latest Claude models available on your API key:- Claude Opus 4.6 - Most capable model for complex reasoning
- Claude Sonnet 4.6 - Balanced performance and speed
- Claude Haiku 4.5 - Fast model for simple tasks
OAuth Setup
Sign in with your existing Claude Max or Claude Pro subscription using browser-based OAuth authentication.Start OAuth flow
- Open Settings → AI Connections
- Click Add Connection
- Select Claude Max / Pro (OAuth)
- Click Authenticate with Claude
Authenticate in browser
Your browser will open to
claude.ai/oauth/authorize.- Sign in with your Claude account
- Review the requested permissions:
user:inference- Make API calls to Claude modelsuser:profile- Access your account detailsorg:create_api_key- Generate temporary API keys
- Click Authorize
OAuth Implementation Details
Craft Agents uses PKCE (Proof Key for Code Exchange) for secure OAuth without a client secret. This is the recommended flow for desktop applications. OAuth Configuration:packages/shared/src/auth/claude-oauth-config.ts:8-36
Using Claude Agent SDK
All Anthropic connections use the Claude Agent SDK as the backend. This provides:- Native tool support - MCP servers, APIs, and built-in tools
- Streaming responses - Real-time output as Claude thinks
- Session persistence - Conversation history and context
- Permission modes - Safe/Ask/Auto approval for tool use
packages/shared/src/agent/claude-agent.ts with:
packages/shared/src/agent/claude-agent.ts
Pricing
API pricing is based on input and output tokens. Current rates (as of March 2026):| Model | Input | Output | Context Window |
|---|---|---|---|
| Claude Opus 4.6 | $15/M tokens | $75/M tokens | 200K |
| Claude Sonnet 4.6 | $3/M tokens | $15/M tokens | 200K |
| Claude Haiku 4.5 | $0.80/M tokens | $4/M tokens | 200K |
Troubleshooting
Authentication failed
Authentication failed
Error:
Authentication failed. Check your API key or OAuth token.Solutions:- Verify your API key starts with
sk-ant-and has no extra whitespace - For OAuth: Sign out and re-authenticate
- Check that your Claude subscription is active
- Ensure you have sufficient API credits (for API key connections)
Rate limits
Rate limits
Error:
Rate limited or quota exceeded. Try again later.Anthropic enforces rate limits based on your tier:- Tier 1 (new accounts): 50 requests/minute
- Tier 4 (high usage): 2,000 requests/minute
Model not available
Model not available
Error:
Model not found. Check the connection configuration.Some models require special access:- Claude Opus 4.6 requires Tier 2+ API access
- Check your account’s model availability
Next Steps
Connect Sources
Add MCP servers, APIs, and data sources
Create Skills
Write custom instructions for specialized tasks