Core Resources
Sandbox
A sandbox is an isolated virtual machine environment for code execution. Each sandbox has:| Field | Type | Description |
|---|---|---|
id | string | Unique sandbox identifier |
status | string | Current status (see statuses below) |
template_id | string | Template ID used to create sandbox |
template_name | string | Template name |
region | string | Deployment region |
resources | object | Allocated vCPU, memory, disk |
auth_token | string | JWT token for VM Agent API access |
token_expires_at | string | JWT token expiration (ISO 8601) |
public_host | string | VM Agent API base URL |
timeout_seconds | integer | Auto-shutdown timeout |
created_at | string | Creation timestamp (ISO 8601) |
updated_at | string | Last update timestamp (ISO 8601) |
Sandbox Statuses
| Status | Description |
|---|---|
creating | Sandbox is being created |
running | Sandbox is active and ready |
stopped | Sandbox is stopped (can be restarted) |
paused | Sandbox is paused (RAM preserved) |
error | Sandbox creation or operation failed |
deleted | Sandbox has been deleted |
Sandbox Lifecycle
Template
A template defines the base image and resources for creating sandboxes:| Field | Type | Description |
|---|---|---|
id | string | Unique template identifier |
name | string | Template name (unique, used as identifier) |
display_name | string | Human-readable name |
description | string | Template description |
category | string | Template category (python, nodejs, ubuntu, etc.) |
language | string | Primary programming language |
default_resources | object | Default vCPU, memory, disk allocation |
features | array | Supported features |
is_public | boolean | Whether template is publicly available |
is_active | boolean | Whether template is ready for use |
status | string | Template status (active, building, failed) |
Template Categories
- python - Python environments (various versions)
- nodejs - Node.js environments
- ubuntu - Ubuntu base images
- code-interpreter - Multi-language execution environments
- custom - Custom organization templates
Execution Result
Result from code execution or command:| Field | Type | Description |
|---|---|---|
success | boolean | Whether execution succeeded |
stdout | string | Standard output |
stderr | string | Standard error |
exit_code | integer | Exit code (0 = success) |
execution_time | number | Execution time in seconds |
| Field | Type | Description |
|---|---|---|
rich_outputs | array | Array of rich output objects |
| Field | Type | Description |
|---|---|---|
type | string | MIME type (image/png, text/html, etc.) |
format | string | Data format (base64, text) |
data | string | Output data |
metadata | object | Additional metadata |
Process
Background execution process:| Field | Type | Description |
|---|---|---|
process_id | string | Unique process identifier |
execution_id | string | Execution ID |
name | string | Process name (optional) |
status | string | Process status (queued, running, completed, failed) |
language | string | Programming language |
started_at | string | Start timestamp (ISO 8601) |
completed_at | string | Completion timestamp (ISO 8601, if complete) |
stdout | string | Standard output |
stderr | string | Standard error |
exit_code | integer | Exit code (null if still running) |
Object Types
All API responses include anobject field identifying the resource type:
| Object Type | Description |
|---|---|
sandbox | Sandbox resource |
template | Template resource |
list | List of resources with pagination |
error | Error response |
List Objects
List endpoints return a consistent structure:| Field | Type | Description |
|---|---|---|
object | string | Always “list” |
data | array | Array of resource objects |
has_more | boolean | Whether more results exist |
next_cursor | string | Cursor for next page (if has_more) |
url | string | Endpoint URL |
request_id | string | Request ID for debugging |
Timestamps
All timestamps use ISO 8601 format with UTC timezone:created_at- Resource creation timeupdated_at- Last modification timecompleted_at- Task completion timeexpires_at- Expiration timetoken_expires_at- JWT token expiration
Identifiers
Format
Identifiers follow consistent patterns:| Prefix | Resource Type | Example |
|---|---|---|
sandbox_ | Sandbox | sandbox_abc123xyz |
template_ | Template | template_xyz789 |
proc_ | Process | proc_abc123 |
exec_ | Execution | exec_xyz789 |
req_ | Request | req_abc123 |
build_ | Template Build | build_abc123 |
Usage
- Identifiers are case-sensitive
- Store identifiers as returned by the API
- Use template
nameoridwhen creating sandboxes
Resource Relationships
- One template can create multiple sandboxes
- Each sandbox has one JWT token (refreshable)
- Each sandbox can have multiple concurrent processes/executions
Common Patterns
Create → Poll → Use
Related
- API Introduction - Learn about the HopX API
- Creating Sandboxes - Learn about sandbox creation
- Managing Sandbox State - Control sandbox lifecycle
- Control Plane API Overview - Manage sandboxes via API
- VM Agent API Overview - Execute code via API
- CLI Reference - Command-line interface
Next Steps
- Errors - Error handling and codes
- Rate Limits - Request rate limits
- Pagination - Paginating list results

