Skip to content

Quickstart

Rookbox speaks the E2B protocol. You use the E2B SDK unmodified and point it at the Rookbox API.

  1. Get a key. Rookbox is in closed beta: join the waitlist at rookbox.run. With your invite, open the Dashboard, go to API keys and create one. The key starts with rbx_ and is shown only once. Copy it right away.

  2. Install the SDK.

    Janela do terminal
    pip install e2b
  3. Set two variables.

    Janela do terminal
    export E2B_API_KEY=rbx_...
    export E2B_API_URL=https://api.rookbox.run
  4. Create a machine and run a command.

    from e2b import Sandbox
    sandbox = Sandbox.create(timeout=15 * 60) # 15 minutes
    print(sandbox.commands.run("uname -a").stdout)
  5. Expose a port.

    sandbox.commands.run("python3 -m http.server 8000", background=True)
    print(sandbox.get_host(8000)) # 8000-<id>.box.rookbox.run

    The address requires a traffic token. See Ports and URLs.

  6. Suspend and resume. In the E2B SDK, pause is Rookbox suspend: memory is kept.

    sandbox_id = sandbox.sandbox_id
    sandbox.beta_pause() # suspend, memory kept
    sandbox = Sandbox.connect(sandbox_id) # resume, about 1 s

    In current SDK versions the method is called beta_pause (Python) and betaPause (TypeScript).

  7. Remove it.

    sandbox.kill()
  • CLI: the same flow in the terminal.
  • Lifecycle: timeout, suspend and removal.
  • Limits: machines per account and what to do on 429 and 503.