智能体

连接电脑

取得这台电脑所在沙箱的连接凭据,用 E2B SDK 直连运行命令、开终端、读写文件。

先调用「创建计算机」,用返回的计算机 ID 替换 cmp_123。

POST /agent/v1/computers/{computer_id}/connect● 支持

请求参数

  • computer_idstring必填

    path: Computer id (cmp_...), as returned by computers.create or computers.list.

返回

200

Praxis 自有扩展:Managed Agents 没有持久 Computer 连接。返回 SDK 可用的公开 sandbox_id、envd_access_token 和 template_id。归档电脑仍可连接;跨租户或不存在返回 404。连接凭证不可缓存。

错误按 Anthropic 错误格式返回(type / message / request_id),参见 错误码

响应

HTTP 200

Computer result

application/json

名称类型说明
sandbox_idstringPublic id of the sandbox that backs the computer, usable with the sandbox API; null while none has been created.
envd_access_tokenstringAccess token for the sandbox's environment daemon, returned by the connect call; treat it as a secret.
template_idstringSandbox template the computer's sandbox was created from.