Last Verified: 2025-01-27
Package:
hopx-ai on PyPI
Overview
The Python SDK provides data models for all API responses and objects. These models provide type safety, convenience methods, and clear documentation of data structures.Import
Core Models
SandboxInfo
Sandbox information model.
Fields:
sandbox_id(str): Unique sandbox identifiertemplate_id(str): Template ID used to create sandboxtemplate_name(str): Template nameorganization_id(str): Organization IDnode_id(str): Node IDregion(str): Deployment regionstatus(str): Sandbox status ("running","stopped","paused","creating")public_host(str): Public hostnameresources(Resources): Resource specificationsstarted_at(datetime): Start timestampend_at(datetime, optional): End timestampcreated_at(datetime): Creation timestamp
Template
Template information model.
Fields:
id(str): Template IDname(str): Template namedisplay_name(str): Display namedescription(str): Template descriptioncategory(str): Template categorylanguage(str): Primary languageicon(str, optional): Icon URLdefault_resources(TemplateResources): Default resource specificationsmin_resources(TemplateResources): Minimum resourcesmax_resources(TemplateResources): Maximum resourcesfeatures(List[str]): Available featurestags(List[str]): Template tagspopularity_score(float): Popularity scoredocs_url(str, optional): Documentation URLis_active(bool): Whether template is activestatus(str): Template status
ExecutionResult
Result of code execution.
Fields:
success(bool): Whether execution succeededstdout(str): Standard outputstderr(str): Standard errorexit_code(int): Exit code (0 = success)execution_time(float): Execution time in secondsrich_outputs(List[RichOutput]): Rich outputs (plots, DataFrames, etc.)
rich_count(int): Number of rich outputs
CommandResult
Result of command execution.
Fields:
stdout(str): Standard outputstderr(str): Standard errorexit_code(int): Exit codeexecution_time(float): Execution time in seconds
success(bool): Whether command succeeded (exit_code == 0)
FileInfo
File or directory information.
Fields:
name(str): File or directory namepath(str): Full pathsize(int): Size in bytesis_directory(bool): Whether it’s a directorypermissions(str): File permissionsmodified_time(datetime): Last modification time
is_file(bool): Whether it’s a fileis_dir(bool): Whether it’s a directorysize_kb(float): Size in kilobytessize_mb(float): Size in megabytes
RichOutput
Rich output from code execution (plots, DataFrames, etc.).
Fields:
type(str): Output type ("plot","dataframe","html", etc.)data(strorbytes): Output datametadata(Dict[str, Any]): Additional metadatatimestamp(datetime): Output timestamp
Desktop Models
VNCInfo
VNC server information.
Fields:
running(bool): Whether VNC is runningdisplay(int): Display numberport(int): VNC porturl(str): VNC URLpassword(str): VNC password
WindowInfo
Window information.
Fields:
id(str): Window IDtitle(str): Window titlex(int): X coordinatey(int): Y coordinatewidth(int): Window widthheight(int): Window heightdesktop(int): Desktop numberpid(int): Process ID
RecordingInfo
Screen recording information.
Fields:
recording_id(str): Recording IDstatus(str): Recording statusfps(int): Frames per secondformat(str): Video formatduration(float): Duration in secondsfile_size(int): File size in bytes
is_recording(bool): Whether recording is activeis_ready(bool): Whether recording is ready
DisplayInfo
Display information.
Fields:
width(int): Display widthheight(int): Display heightdepth(int): Color depth
resolution(Tuple[int, int]): Resolution tuple
Resource Models
Resources
Resource specifications.
Fields:
vcpu(int): Number of vCPUsmemory_mb(int): Memory in megabytesdisk_mb(int): Disk space in megabytes
TemplateResources
Template resource specifications.
Fields:
vcpu(int): Number of vCPUsmemory_mb(int): Memory in megabytesdisk_gb(int): Disk space in gigabytes
Related Classes
See Also
- Errors - Learn about error handling
- Core Concepts - Learn about core concepts
Next Steps
Now that you understand data models, explore:- Sandbox Operations - Use models in practice
- Error Handling - Type-safe error handling
- Quickstart Guide - Get started with the SDK
- CLI Reference - Use HopX from the command line
- Python Type Hints - Learn more about type hints

