You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: fill five sandbox lifecycle and template doc gaps (#284)
* docs: fill five sandbox lifecycle and template doc gaps
Close documentation gaps surfaced by customers:
- persistence: state on_timeout defaults to "kill"; expand paused-sandbox
retention (indefinite, no auto-kill, explicit kill required)
- base-image: document base template default resources (2 vCPU, 512 MiB)
and pre-installed tooling with a link to the public Dockerfile
- build: clarify disk size is tier-derived at build time, not a
per-sandbox parameter
- lifecycle events API: document 7-day event retention
- lifecycle webhooks: document delivery retry policy and idempotency
- billing: fix stale default RAM (1 GB -> 512 MiB)
* docs: drop explicit-kill bullet from paused retention per review
* docs: reword paused-sandbox removal bullet (free -> remove)
Copy file name to clipboardExpand all lines: docs/billing.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,7 +96,7 @@ Check your usage and costs in the [dashboard usage tab](https://e2b.dev/dashboar
96
96
-**Enable auto-pause** - Automatically pause sandboxes after a period of inactivity to stop billing while preserving state
97
97
-**Pause sandboxes when idle** - Use `sbx.pause()` to stop billing while keeping state available for later
98
98
-**Kill sandboxes you no longer need** - Use `sbx.kill()` to stop billing and release resources permanently
99
-
-**Allocate only what you need** - Start with default resources (2 vCPU, 1 GB RAM) and increase only if necessary
99
+
-**Allocate only what you need** - Start with default resources (2 vCPU, 512 MiB RAM) and increase only if necessary
100
100
-**Monitor actively running sandboxes** - Use the [CLI](/docs/cli/list-sandboxes) or [dashboard](https://e2b.dev/dashboard?tab=usage) to track active sandboxes
101
101
-**Use lifecycle events** - Set up [webhooks](/docs/sandbox/lifecycle-events-webhooks) to get notified when sandboxes are created
Copy file name to clipboardExpand all lines: docs/sandbox/lifecycle-events-api.mdx
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,10 @@ sidebarTitle: Lifecycle events API
6
6
The lifecycle API provides RESTful endpoints to request the latest sandbox lifecycle events. This allows you to track when sandboxes are created, paused, resumed, updated, snapshotted, or killed, along with metadata.
7
7
All requests require authentication using your team [API key](/docs/api-key#where-to-find-api-key).
8
8
9
+
## Retention
10
+
11
+
Sandbox lifecycle events are retained for **7 days** by default. After the retention window passes, a sandbox's events are no longer available through this API.
12
+
9
13
Query Parameters:
10
14
-`offset` (optional): Number of events to skip (default: 0, min: 0)
11
15
-`limit` (optional): Number of events to return (default: 10, min: 1, max: 100)
Copy file name to clipboardExpand all lines: docs/sandbox/lifecycle-events-webhooks.mdx
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -352,6 +352,12 @@ When webhooks is send, we are adding headers to help you verify the authenticity
352
352
-`e2b-signature-version` - Currently always `v1`, reserved for future use
353
353
-`e2b-signature` - Signature for verifying the request authenticity`
354
354
355
+
## Delivery and retries
356
+
357
+
If a delivery fails, E2B retries it **up to 3 times, 10 seconds apart**. A delivery is treated as failed when your endpoint returns a 4xx or 5xx status code, the request times out, or it fails with a network error.
358
+
359
+
Because a delivery can be retried, the same event may be delivered more than once. Make your webhook handler idempotent and use the `e2b-delivery-id` header to deduplicate deliveries you've already processed.
360
+
355
361
## Available event types
356
362
357
363
The following event types can be subscribed to via webhooks, they are used as the `type` field in the [payload](#webhook-payload).
Auto-pause is configured in the sandbox lifecycle on create. Set `onTimeout`/`on_timeout` to `pause`.
232
+
Auto-pause is configured in the sandbox lifecycle on create. `onTimeout`/`on_timeout`defaults to `"kill"`, meaning the sandbox is terminated when its timeout expires. Set it to `"pause"` to auto-pause on timeout instead.
"on_timeout": "pause", # Auto-pause after the sandbox times out
253
-
"auto_resume": False, # Optional (default is False)
252
+
"on_timeout": "pause", # Defaults to "kill"; set to "pause" to auto-pause on timeout
253
+
"auto_resume": False, # Optional (default is False)
254
254
},
255
255
)
256
256
```
@@ -276,8 +276,10 @@ If you resume the sandbox, the service will be accessible again but you need to
276
276
- Resuming a sandbox takes approximately **1 second**
277
277
278
278
### Paused sandbox retention
279
-
- Paused sandboxes are kept **indefinitely** — there is no automatic deletion or time-to-live limit
279
+
- Paused sandboxes are kept **indefinitely**; there is no automatic deletion or time-to-live limit
280
+
- There is currently **no configurable "auto-kill after N days" option**; a paused sandbox will not expire on its own
280
281
- You can resume a paused sandbox at any time
282
+
- To remove a paused sandbox, you must kill it explicitly with an API call (`sandbox.kill()` / `Sandbox.kill(sandboxId)`), as shown in [Removing paused sandboxes](#removing-paused-sandboxes)
281
283
282
284
### Continuous runtime limits
283
285
- A sandbox can remain running (without being paused) for:
`base` is also the template used when you call `Sandbox.create()` without specifying one. It is Debian-based and comes with common tooling pre-installed: Python 3, Node.js, Yarn, `git`, `curl`, `build-essential`, and the GitHub CLI (`gh`). For the exact contents, see the public Dockerfile: [`templates/base/e2b.Dockerfile`](https://github.com/e2b-dev/E2B/blob/main/templates/base/e2b.Dockerfile).
95
+
96
+
### Default resources
97
+
98
+
A sandbox gets its CPU and memory from the template it's built on. A sandbox built from `base` starts with **2 vCPU and 512 MiB of RAM**.
99
+
100
+
You can override CPU and memory when you [build a template](/docs/template/build) (`cpuCount`/`cpu_count`, `memoryMB`/`memory_mb`). Disk size is not a default you set per sandbox; it's determined by your team's tier limit and applied at build time (see [Build limits](/docs/template/quickstart#build-limits)).
101
+
94
102
### Build from existing template
95
103
96
104
Extend an existing template from your team or organization:
Copy file name to clipboardExpand all lines: docs/template/build.mdx
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,10 @@ build_info = Template.build(
39
39
40
40
</CodeGroup>
41
41
42
+
<Note>
43
+
**Disk size is not a per-sandbox setting.** Unlike `cpuCount`/`cpu_count` and `memoryMB`/`memory_mb`, there is no disk-size parameter, neither on the template build nor on `Sandbox.create`. A sandbox's disk size is determined by your team's tier limit and applied when the template is built (see [Build limits](/docs/template/quickstart#build-limits)). `diskSizeMB` only ever appears in API response payloads (for example on sandbox and template info), never as an input. To get a larger disk, raise your tier or contact [support@e2b.dev](mailto:support@e2b.dev).
44
+
</Note>
45
+
42
46
## Build in background
43
47
44
48
The `buildInBackground` method starts the build process and returns immediately without waiting for completion. This is useful when you want to trigger a build and check its status later.
0 commit comments