Two-API Model
1. Lifecycle API
Purpose: Manage sandboxes (create, delete, start, stop, pause, resume) Base URL:https://api.hopx.dev
Authentication: API Key in X-API-Key header
Used for:
- Creating and deleting sandboxes
- Listing sandboxes
- Starting/stopping/pausing sandboxes
- Managing templates
2. VM Agent API
Purpose: Interact with code inside sandbox Base URL:https://{sandbox-id}.{region}.hopx.dev
Authentication: API Key in X-API-Key header
Used for:
- Running code
- File operations
- Command execution
- Process management
- Metrics and observability
How It Works
Step-by-Step Flow
- Create Sandbox: Your app calls the Lifecycle API to create a new sandbox
- Get Sandbox URL: Lifecycle API returns the sandbox ID and VM Agent URL
- Execute Code: Your app calls the VM Agent API to run code, manage files, etc.
- Manage Lifecycle: Your app calls the Lifecycle API to start, stop, pause, or delete the sandbox
The SDK handles both APIs automatically. You don’t need to manage API endpoints or authentication headers - just use the SDK methods.
SDK Abstraction
The SDK abstracts away the complexity of managing two APIs:- Python
- JavaScript/TypeScript
- Calls the Lifecycle API to create the sandbox
- Stores the VM Agent URL internally
- Routes code execution calls to the VM Agent API
- Manages authentication headers automatically
- Handles retries and error recovery
Benefits of Two-API Architecture
Scalability
Scalability
Separating lifecycle management from code execution allows each API to scale independently based on demand.
Security
Security
VM Agent API endpoints are sandbox-specific, providing better isolation and security boundaries.
Performance
Performance
Direct communication with VM Agent reduces latency for code execution operations.
Flexibility
Flexibility
Different APIs can be optimized for different use cases (lifecycle vs. execution).

