Let's get you set up with the Anthropic API so you can start building with Claude.
Step 1: Create an Account
Visit the Anthropic Console and create your account. You will need:
- A valid email address
- A payment method (for API usage)
Step 2: Get Your API Key
Once logged in:
- Navigate to API Keys in the sidebar
- Click Create Key
- Give it a descriptive name (e.g.,
my-first-app) - Copy and save the key securely
Important: Never commit your API key to version control. Use environment variables instead.
Step 3: Install the SDK
# Python
pip install anthropic
# TypeScript/JavaScript
npm install @anthropic-ai/sdk
Step 4: Test Your Setup
import anthropic
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[
{"role": "user", "content": "Hello, Claude!"}
]
)
print(message.content[0].text)
If you see a response, you are all set!