Skip to main content
Understanding these core concepts will help you get the most out of Hopx Sandboxes.

Quick Overview

A Hopx Sandbox is an isolated virtual machine that:
  • Starts fast: ~100ms cold start time
  • Runs anywhere: Cloud-hosted, globally distributed
  • Stays isolated: Has its own filesystem, processes, and network
  • Can be paused: Preserve state and resume later
  • Is disposable: Create thousands, destroy when done
Think of a sandbox as a disposable computer for your AI model or application. Create it, use it, destroy it - pay only for what you use.

What is a Sandbox?

A Hopx Sandbox is a lightweight, isolated virtual machine (microVM) that provides a secure environment for running untrusted code. Each sandbox is completely isolated from others and includes:
  • Dedicated resources: CPU, memory, disk, network
  • Pre-configured environment: Choose from templates or build custom ones
  • Full filesystem access: Read, write, and manage files
  • Network access: Make outbound requests, receive inbound connections
  • State management: Pause, resume, or persist state

Sandbox Properties

When you create a sandbox, it includes these properties:
  • sandbox_id: Unique identifier for the sandbox
  • status: Current state (running, stopped, paused, creating)
  • template_name: Name of the template used
  • region: Geographic region where the sandbox is deployed
  • resources: CPU, memory, and disk allocation
  • public_host: Public URL to access the sandbox
  • Python
  • JavaScript/TypeScript
from hopx_ai import Sandbox

sandbox = Sandbox.create(template="code-interpreter")
info = sandbox.get_info()

print(f"Sandbox ID: {info.sandbox_id}")
print(f"Status: {info.status}")
print(f"Template: {info.template_name}")
print(f"Region: {info.region}")
if info.resources:
    print(f"vCPU: {info.resources.vcpu}")
    print(f"Memory: {info.resources.memory_mb} MB")
    print(f"Disk: {info.resources.disk_mb / 1024:.1f} GB")
print(f"URL: {info.public_host}")

# Clean up when done
sandbox.kill()

Core Concepts Overview


Next Steps

Questions? Join our Discord community for help and discussions.