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

SoftwareWhich versionPurpose
PythonWhatever the SDK currently requires — see the SDK READMESDK and scripts
DockerCurrent stableSandboxed environment
Anthropic SDKLatest (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 — pip enforces it and will tell you if your interpreter is too old. Pin versions in your requirements.txt, not from a tutorial table.

Getting Your API Key

  1. Go to console.anthropic.com
  2. Navigate to API Keys
  3. Create a new key with a descriptive name
  4. 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

ComponentCost Factor
ScreenshotsImage tokens (varies by resolution)
Tool callsStandard output tokens
Long sessionsContext 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. :::

Quiz

Module 2: Development Environment

Take Quiz
Was this lesson helpful?

Sign in to rate