Skip to content

Commit 19a57f0

Browse files
committed
Restore beta SDK method names (betaPause, betaCreate)
The previous commit incorrectly renamed the SDK methods. The beta labels/notes in the docs are removed but the actual API methods (betaPause, beta_pause, betaCreate, beta_create) are still the current SDK surface.
1 parent 601367f commit 19a57f0

3 files changed

Lines changed: 17 additions & 17 deletions

File tree

docs/agents/openclaw.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ This sandbox is created with a 10-minute timeout and auto-pause enabled — afte
394394
```typescript JavaScript & TypeScript
395395
import { Sandbox } from 'e2b'
396396

397-
const sandbox = await Sandbox.create('openclaw', {
397+
const sandbox = await Sandbox.betaCreate('openclaw', {
398398
envs: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY },
399399
autoPause: true,
400400
timeoutMs: 10 * 60 * 1000,
@@ -412,7 +412,7 @@ console.log(`Sandbox ID: ${sandbox.sandboxId}`)
412412
import os
413413
from e2b import Sandbox
414414

415-
sandbox = Sandbox.create("openclaw", envs={
415+
sandbox = Sandbox.beta_create("openclaw", envs={
416416
"ANTHROPIC_API_KEY": os.environ["ANTHROPIC_API_KEY"],
417417
}, auto_pause=True, timeout=10 * 60)
418418

docs/agents/opencode.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ OpenCode includes a [headless HTTP server](https://opencode.ai/docs/server/) tha
120120
import { Sandbox } from 'e2b'
121121
import { createOpencodeClient } from '@opencode-ai/sdk'
122122

123-
const sandbox = await Sandbox.create('opencode', {
123+
const sandbox = await Sandbox.betaCreate('opencode', {
124124
envs: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY },
125125
autoPause: true,
126126
timeoutMs: 10 * 60 * 1000,
@@ -166,7 +166,7 @@ import time
166166
import requests
167167
from e2b import Sandbox
168168

169-
sandbox = Sandbox.create("opencode", envs={
169+
sandbox = Sandbox.beta_create("opencode", envs={
170170
"ANTHROPIC_API_KEY": os.environ["ANTHROPIC_API_KEY"],
171171
}, auto_pause=True, timeout=10 * 60)
172172

docs/sandbox/persistence.mdx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { Sandbox } from '@e2b/code-interpreter'
4444
const sandbox = await Sandbox.create() // Starts in Running state
4545

4646
// Pause the sandbox
47-
await sandbox.pause() // Running → Paused
47+
await sandbox.betaPause() // Running → Paused
4848

4949
// Resume the sandbox
5050
await sandbox.connect() // Running/Paused → Running
@@ -59,7 +59,7 @@ from e2b_code_interpreter import Sandbox
5959
sandbox = Sandbox.create() # Starts in Running state
6060

6161
# Pause the sandbox
62-
sandbox.pause() # Running → Paused
62+
sandbox.beta_pause() # Running → Paused
6363

6464
# Resume the sandbox
6565
sandbox.connect() # Running/Paused → Running
@@ -81,7 +81,7 @@ console.log('Sandbox created', sbx.sandboxId)
8181

8282
// Pause the sandbox
8383
// You can save the sandbox ID in your database to resume the sandbox later
84-
await sbx.pause()
84+
await sbx.betaPause()
8585
console.log('Sandbox paused', sbx.sandboxId)
8686
```
8787
```python Python highlight={8-9}
@@ -92,8 +92,8 @@ print('Sandbox created', sbx.sandbox_id)
9292

9393
# Pause the sandbox
9494
# You can save the sandbox ID in your database to resume the sandbox later
95-
sbx.pause()
96-
print('Sandbox paused', sbx.sandbox_id)
95+
sbx.beta_pause()
96+
print('Sandbox paused', sbx.sandbox_id)
9797
```
9898
</CodeGroup>
9999

@@ -111,7 +111,7 @@ console.log('Sandbox created', sbx.sandboxId)
111111

112112
// Pause the sandbox
113113
// You can save the sandbox ID in your database to resume the sandbox later
114-
await sbx.pause()
114+
await sbx.betaPause()
115115
console.log('Sandbox paused', sbx.sandboxId)
116116

117117
// Connect to the sandbox (it will automatically resume the sandbox, if paused)
@@ -126,7 +126,7 @@ print('Sandbox created', sbx.sandbox_id)
126126

127127
# Pause the sandbox
128128
# You can save the sandbox ID in your database to resume the sandbox later
129-
sbx.pause()
129+
sbx.beta_pause()
130130
print('Sandbox paused', sbx.sandbox_id)
131131

132132
# Connect to the sandbox (it will automatically resume the sandbox, if paused)
@@ -184,7 +184,7 @@ console.log('Sandbox created', sbx.sandboxId)
184184

185185
// Pause the sandbox
186186
// You can save the sandbox ID in your database to resume the sandbox later
187-
await sbx.pause()
187+
await sbx.betaPause()
188188

189189
// Remove the sandbox
190190
await sbx.kill()
@@ -198,7 +198,7 @@ from e2b_code_interpreter import Sandbox
198198
sbx = Sandbox.create()
199199

200200
# Pause the sandbox
201-
sbx.pause()
201+
sbx.beta_pause()
202202

203203
# Remove the sandbox
204204
sbx.kill()
@@ -234,7 +234,7 @@ Sandboxes automatically pause when they've been idle, preserving their full stat
234234
import { Sandbox } from '@e2b/code-interpreter'
235235

236236
// Create sandbox with auto-pause enabled
237-
const sandbox = await Sandbox.create({
237+
const sandbox = await Sandbox.betaCreate({
238238
autoPause: true,
239239
timeoutMs: 10 * 60 * 1000 // Optional: change the default timeout (10 minutes)
240240
})
@@ -243,7 +243,7 @@ const sandbox = await Sandbox.create({
243243
from e2b_code_interpreter import Sandbox
244244

245245
# Create sandbox with auto-pause enabled
246-
sandbox = Sandbox.create(
246+
sandbox = Sandbox.beta_create(
247247
auto_pause=True, # Auto-pause after the sandbox times out
248248
timeout=10 * 60, # Optional: change the default timeout (10 minutes)
249249
)
@@ -259,15 +259,15 @@ If you `.kill()` the sandbox, it will be permanently deleted and you won't be ab
259259
import { Sandbox } from '@e2b/code-interpreter'
260260

261261
// Create sandbox with auto-pause enabled
262-
const sandbox = await Sandbox.create({
262+
const sandbox = await Sandbox.betaCreate({
263263
autoPause: true // Auto-pause after the sandbox times out
264264
})
265265
```
266266
```python Python
267267
from e2b_code_interpreter import Sandbox
268268

269269
# Create sandbox with auto-pause enabled
270-
sandbox = Sandbox.create(
270+
sandbox = Sandbox.beta_create(
271271
auto_pause=True # Auto-pause after the sandbox times out
272272
)
273273
```

0 commit comments

Comments
 (0)