From anthropic-pack
Installs Anthropic Claude SDK and configures API key authentication for Python and TypeScript. Verifies setup with test messages to Claude models.
How this skill is triggered — by the user, by Claude, or both
Slash command
/anthropic-pack:anth-install-authThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Set up the official Anthropic SDK for Python or TypeScript and configure API key authentication. The SDK wraps the Claude Messages API at `https://api.anthropic.com/v1/messages`.
Set up the official Anthropic SDK for Python or TypeScript and configure API key authentication. The SDK wraps the Claude Messages API at https://api.anthropic.com/v1/messages.
# Python
pip install anthropic
# TypeScript / Node.js
npm install @anthropic-ai/sdk
# With pnpm
pnpm add @anthropic-ai/sdk
# Set environment variable (recommended)
export ANTHROPIC_API_KEY="sk-ant-api03-..."
# Or add to .env file
echo 'ANTHROPIC_API_KEY=sk-ant-api03-your-key-here' >> .env
# Verify it's set
echo $ANTHROPIC_API_KEY | head -c 15
# Expected: sk-ant-api03-...
import anthropic
client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY from env
message = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=64,
messages=[{"role": "user", "content": "Say hello in exactly 5 words."}]
)
print(message.content[0].text)
print(f"Model: {message.model}, Tokens: {message.usage.input_tokens}+{message.usage.output_tokens}")
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic(); // reads ANTHROPIC_API_KEY from env
const message = await client.messages.create({
model: 'claude-sonnet-4-20250514',
max_tokens: 64,
messages: [{ role: 'user', content: 'Say hello in exactly 5 words.' }],
});
if (message.content[0].type === 'text') {
console.log(message.content[0].text);
}
console.log(`Stop reason: ${message.stop_reason}`);
anthropic for Python, @anthropic-ai/sdk for TS)ANTHROPIC_API_KEY configured| Error | HTTP Code | Cause | Solution |
|---|---|---|---|
authentication_error | 401 | Invalid or missing API key | Verify key starts with sk-ant-api03- |
permission_error | 403 | Key lacks required scope | Generate new key in Console |
not_found_error | 404 | Invalid API endpoint | Ensure SDK is latest version |
ModuleNotFoundError | N/A | SDK not installed | Run pip install anthropic or npm install @anthropic-ai/sdk |
connection_error | N/A | Network/firewall blocking | Ensure HTTPS to api.anthropic.com is allowed |
# Custom base URL (for proxied environments)
client = anthropic.Anthropic(
api_key="sk-ant-...",
base_url="https://your-proxy.internal.com/v1",
timeout=60.0,
max_retries=3
)
# With explicit headers
client = anthropic.Anthropic(
default_headers={"anthropic-beta": "messages-2024-12-19"}
)
.env files with .gitignore exclusionAfter successful auth, proceed to anth-hello-world for your first Messages API call.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin anthropic-packApplies production-ready Anthropic SDK patterns for TypeScript and Python, covering typed wrappers, retries, streaming, and multi-turn conversations for Claude integrations.
Builds LLM-powered applications with Claude API, Anthropic SDKs, or Agent SDK. Detects project language (Python, TypeScript, Java, Go, Ruby, C#, PHP) and provides language-specific docs and defaults.
Provides instructions for building LLM-powered apps with the Claude API or Anthropic SDK, including language detection and code examples for Python, TypeScript, Java, Go, Ruby, and more.