APIRemoteWorkspace to connect to a OpenHands runtime API service. This eliminates the need to manage your own infrastructure, providing automatic scaling, monitoring, and secure sandboxed execution.
Basic Example
This example is available on GitHub: examples/02_remote_agent_server/04_convo_with_api_sandboxed_server.py
examples/02_remote_agent_server/04_convo_with_api_sandboxed_server.py
Running the Example
Key Concepts
APIRemoteWorkspace
TheAPIRemoteWorkspace connects to a hosted runtime API service:
- Connects to a remote runtime API service
- Automatically provisions sandboxed environments
- Manages container lifecycle through the API
- Handles all infrastructure concerns
Runtime API Authentication
The example requires a runtime API key for authentication:Pre-built Image Selection
You can specify which pre-built agent server image to use:Workspace Testing
Just like with DockerWorkspace, you can test the workspace before running the agent:Automatic RemoteConversation
The conversation uses WebSocket communication with the remote server:Next Steps
- Docker Sandbox - Run with DockerWorkspace
- Local Agent Server - Development without containers
- Remote Agent Server Overview - Workspace types and deployment options
- Agent Server Architecture - Technical details, endpoints, authentication

