E2BRuntime connects to a live E2B sandbox by id. Create
it with E2B’s CLI or SDK from a template carrying Mirage and fuse3, then
provision the workspace inside it. Mirage only connects and executes; it never
creates, starts, stops, or deletes the sandbox.
See the Sandbox overview for the shared image and
matching mount-prefix setup.
Install
Configure
api_key is optional when E2B_API_KEY is set. The runtime connects on the
first captured line and reuses the sandbox client until the workspace closes.
Closing the workspace releases the client and leaves the sandbox running.
The same configuration in application code is: