HomeGetting StartedSetting Up Your Environment
beginner15 min read· Module 2, Lesson 2

🔧Setting Up Your Environment

Get your API key and install everything you need

Setting Up Your Environment

Let's get everything installed and ready. By the end of this lesson, you'll be ready to talk to Claude from your computer.

Step 1: Create an Anthropic Account

  1. Go to console.anthropic.com
  2. Click Sign Up
  3. Enter your email and create a password
  4. Verify your email

Step 2: Get Your API Key

  1. After logging in, go to Settings → API Keys
  2. Click Create Key
  3. Give it a name (e.g., "my-learning-key")
  4. Copy the key immediately — you won't see it again!

Important: Your API key looks like sk-ant-api03-... Keep it secret!

Step 3: Install Node.js (for JavaScript/TypeScript)

If you don't have Node.js installed:

  1. Go to nodejs.org
  2. Download the LTS version (Long Term Support)
  3. Run the installer
  4. Verify installation:
Terminal
node --version # Should show v18+ or higher npm --version # Should show 9+ or higher

Step 4: Install Python (Optional)

If you prefer Python:

  1. Go to python.org
  2. Download the latest version
  3. Run the installer (check "Add to PATH"!)
  4. Verify:
Terminal
python --version # Should show 3.8+ pip --version # Should work

Step 5: Set Your API Key as an Environment Variable

This keeps your key safe (not in your code):

macOS / Linux:

Terminal
echo 'export ANTHROPIC_API_KEY="your-key-here"' >> ~/.zshrc source ~/.zshrc

Windows (PowerShell):

PowerShell
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY", "your-key-here", "User")

Step 6: Install the SDK

For JavaScript/TypeScript:

Terminal
npm install @anthropic-ai/sdk

For Python:

Terminal
pip install anthropic

Step 7: Verify Everything Works

Create a test file:

JavaScript (test.js):

JavaScript
import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic(); const message = await client.messages.create({ model: "claude-sonnet-4-6", max_tokens: 100, messages: [{ role: "user", content: "Say hello!" }] }); console.log(message.content[0].text);

Python (test.py):

Python
import anthropic client = anthropic.Anthropic() message = client.messages.create( model="claude-sonnet-4-6", max_tokens=100, messages=[{"role": "user", "content": "Say hello!"}] ) print(message.content[0].text)

Run it:

Terminal
node test.js # JavaScript python test.py # Python

If you see Claude's response, congratulations — you're ready!

Next up: We'll dive into making your first real API call and understanding the response.