SuperAPI AI 工具集

e2b-sandbox

部署与运维

查看项目

更新于 10-15 20:27

技能介绍

用途:这是 ComputeSDK 的 E2B 提供商指南,用于在应用中创建和管理 E2B 云端沙箱。E2B 沙箱提供完整 Linux 环境、文件系统访问和 microVM 隔离。

安装与配置:使用 npm install computesdk @computesdk/e2b 安装依赖,并通过环境变量 E2B_API_KEY 提供凭据。

主要能力:ComputeSDK 在各提供商间暴露统一的沙箱 API,包括 sandbox.create()、sandbox.getById()、sandbox.destroy()、sandbox.runCommand()、sandbox.getInfo()、sandbox.getUrl() 以及 sandbox.filesystem.*。E2B 配置支持 apiKey(未提供时回退到 E2B_API_KEY 环境变量)和 timeout(执行超时,单位毫秒)。

使用方式:可通过 compute.setConfig 设置 provider 为 e2b({ apiKey }),再调用 compute.sandbox.create() 创建沙箱,用 sandbox.runCommand() 执行命令并读取 stdout,最后用 sandbox.destroy() 销毁;也可直接调用提供商工厂 e2b({ apiKey }) 后使用 sdk.sandbox.create()。完整参考可安装主技能:npx skills add https://github.com/computesdk/sandbox-skills --skill computesdk,或查阅 https://www.computesdk.com/docs/reference/sandbox/。

限制:资料未提供定价、配额、平台支持范围及具体超时默认值等信息。