Path Parameter
The{path}
parameter is a wildcard that captures the full file path within the VM. For example:
/home/user/script.py
/tmp/output.json
/workspace/data/results.csv
/etc/hosts
(if readable)
Use Cases
- Result Retrieval: Read output files generated by executed commands
- Configuration Access: Read configuration files and settings
- Data Export: Access data files, logs, and generated reports
- AI Agent File Access: Allow AI agents to read files they’ve created or need to analyze
Response Examples
Text File Content
JSON File Content
Binary File Handling
For binary files, the content will be base64 encoded:File Not Found
Instance Not Found
Alternative: Direct File Access
For unauthenticated access (useful for AI agents), you can also use the direct file access endpoint:- Requires no authentication
- Serves files with appropriate MIME types
- Returns raw file content (not JSON wrapped)
- Suitable for images, PDFs, and other binary files
Best Practices
- File Paths: Use absolute paths starting from
/
or relative paths from the VM’s home directory - Large Files: Be mindful that very large files will be returned as base64 encoded strings
- Security: Only files accessible to the VM user can be read
- Caching: File content is read fresh on each request - no caching is performed
- Error Handling: Always check for 404 errors when files might not exist
Authorizations
API key authentication using Bearer token format: 'Bearer rk_live_<key>'
Path Parameters
UUID of the profile
Room identifier
File path within the VM (wildcard path parameter)