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 | Version | Purpose |
|---|---|---|
| Python | 3.10+ | SDK and scripts |
| Docker | Latest | Sandboxed environment |
| Anthropic SDK | 0.40+ | API client |
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>=0.40.0
Verify Installation
from anthropic import Anthropic
client = Anthropic()
# Test API connection
response = client.messages.create(
model="claude-sonnet-4-5-20250514",
max_tokens=100,
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.content[0].text)
Computer Use Beta Access
Computer Use requires the beta header:
response = client.messages.create(
model="claude-sonnet-4-5-20250514",
max_tokens=4096,
betas=["computer-use-2025-01-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. :::