E2B icon

E2B

Run commands and manage E2B sandboxes and snapshots

Sandbox → Kill

AI-generated

Summary

Kill a sandbox identified by its Sandbox ID, terminating it if it exists.

Inputs

  • Sandbox ID (required) — The string identifier of the sandbox to be killed.
  • Timeout — Operation timeout in seconds, defaults to 300 seconds.

Output shape

a single record

Returns an object with the sandboxId and a boolean 'killed' indicating if the sandbox was successfully killed (true), or if it did not exist (false). Throws an error for other failures.

Examples

Example 1: Kill Sandbox Example

Provide the Sandbox ID of the sandbox to kill and optionally configure a timeout in seconds.

Links

Discussion