For technical architecture details (endpoints, authentication, component design), see the Agent Server Package section in the Architecture Overview.
Switching from Local to Remote
Your conversation code stays the same—just swap the workspace:Workspace Types
| Workspace | What It Does | Best For |
|---|---|---|
| DockerWorkspace | Spawns a Docker container with agent server | Local development with isolation, self-hosted deployments |
| APIRemoteWorkspace | Connects to a runtime API that provisions sandboxes | Custom runtime environments, CI/CD pipelines |
| OpenHandsCloudWorkspace | Connects to OpenHands Cloud for managed sandboxes | Production use, no infrastructure management |
| Local Server | Runs agent server in-process | Testing, development without Docker |
How It Works
When you use a remote workspace, the SDK automatically:- Starts or connects to an agent server inside the workspace environment
- Creates a RemoteConversation that communicates via HTTP/WebSocket
- Streams events in real-time through WebSocket callbacks
- Handles cleanup when the context manager exits
File and Command Operations
Workspaces provide file and command operations that work identically whether local or remote:Deployment Options
Self-Hosted (Docker)
UseDockerWorkspace to run agent servers in containers on your own infrastructure:
Runtime API
UseAPIRemoteWorkspace to connect to a runtime API service that provisions sandboxes:
OpenHands Cloud
UseOpenHandsCloudWorkspace for fully managed sandbox environments:
Next Steps
Deployment Guides:- Local Agent Server - Run server in-process for development
- Docker Sandbox - Isolated Docker containers
- API Sandbox - Runtime API integration
- Cloud Workspace - OpenHands Cloud managed sandboxes
- Architecture Overview - Technical details, endpoints, authentication
- Workspace Architecture - Workspace abstraction and implementations

