Use the E2B SDK with guplet

Set the standard E2B environment variables in your Python or Node.js application. Use your team’s guplet API key.

export E2B_DOMAIN=guplet.com
export E2B_API_KEY='guplet_…'

The SDK uses api.guplet.com for lifecycle requests and 49983-<sandboxId>.guplet.com for commands and files. Clear any previous E2B_API_URL or E2B_SANDBOX_URL overrides so the SDK uses those hosts.

Python

pip install e2b==2.67.1
from e2b import Sandbox

with Sandbox.create("toolbox") as sandbox:
    sandbox.files.write("/tmp/hello.txt", "Hello from guplet")
    print(sandbox.commands.run("cat /tmp/hello.txt").stdout)

JavaScript

npm install e2b@2.67.1
import { Sandbox } from 'e2b'

const sandbox = await Sandbox.create('toolbox')
try {
  await sandbox.files.write('/tmp/hello.txt', 'Hello from guplet')
  console.log((await sandbox.commands.run('cat /tmp/hello.txt')).stdout)
} finally {
  await sandbox.kill()
}

Supported operations

Template builds, custom network policies, PTYs, background process controls, and stdin are outside this compatibility API.