Agent

Connect computer

Get connection credentials for this computer’s sandbox and use the E2B SDK to connect directly to run commands, open terminals, and read or write files.

Call Create computer first and replace cmp_123 with its returned ID.

POST /agent/v1/computers/{computer_id}/connect● Supported

Request parameters

  • computer_idstring必填

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

Returns

200

Own-face extension: Managed Agents has no persistent Computer connection. Returns the public SDK sandbox_id, envd_access_token and template_id. Archived computers remain accessible; foreign or absent computers return 404. Never cache credentials.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Computer result

application/json

NameTypeDescription
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.