Setting Up Your Development Environment
Prerequisites and API Setup
4 min read
Before building Computer Use agents, you need to set up your development environment with the right tools and API access.
Required Software
| Software | Which version | Purpose |
|---|---|---|
| Python | Whatever the SDK currently requires — see the SDK README | SDK and scripts |
| Docker | Current stable | Sandboxed environment |
| Anthropic SDK | Latest (pip install anthropic) | API client |
Why no pinned numbers? Minimum versions move, and a course that hardcodes them is wrong within a release or two. The SDK declares its own Python floor —
pipenforces it and will tell you if your interpreter is too old. Pin versions in yourrequirements.txt, not from a tutorial table.
Getting Your API Key
- Go to console.anthropic.com
- Navigate to API Keys
- Create a new key with a descriptive name
- Store it securely (never commit to git)
# Set your API key as environment variable
export ANTHROPIC_API_KEY="sk-ant-..."
Installing the Anthropic SDK
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install the SDK
pip install anthropic
Verify Installation
from anthropic import Anthropic
client = Anthropic()
# Test API connection
response = client.messages.create(
model="claude-sonnet-5",
max_tokens=100,
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.content[0].text)
Computer Use Beta Access
Computer Use requires the computer-use-2025-11-24 beta header — and therefore the beta endpoint:
response = client.beta.messages.create(
model="claude-sonnet-5",
max_tokens=4096,
betas=["computer-use-2025-11-24"],
# ... rest of parameters
)
Cost Considerations
| Component | Cost Factor |
|---|---|
| Screenshots | Image tokens (varies by resolution) |
| Tool calls | Standard output tokens |
| Long sessions | Context window usage |
Tip: Use 1024x768 resolution during development to minimize costs. Scale up for production.
Next, we'll set up Docker for a sandboxed development environment. :::
Was this lesson helpful?
Sign in to rate