Kill a Sandbox

Updated at:

After a task is complete, you can use the CLI to terminate one or more sandboxes.

e2b sandbox kill <sandbox-id>

Terminate multiple sandboxes at once:

e2b sandbox kill <sandbox-id-1> <sandbox-id-2> <sandbox-id-3>

Terminate all sandboxes:

e2b sandbox kill --all

When terminating in bulk, you can filter by state or metadata:

e2b sandbox kill --all --state=running,paused
e2b sandbox kill --all --metadata=key=value
e2b sandbox kill --all --state=running,paused --metadata=key=value

After termination, the sandbox cannot be reconnected or resumed. For scenarios that require pause and later recovery, use the SDK methods sandbox.pause() and Sandbox.connect().