Skip to main content
The Sandbox API runs code in isolated environments. Use an ephemeral run to preview a script once, or a durable session when you need a longer-lived VM (for example while building or debugging a custom tool). Agents can also use native workbench tools; this page covers the REST surface. See also Tools (custom tools) and Native tools.

Ephemeral vs durable

API endpoints

Example: ephemeral run

Required fields: language (javascript | python) and source (script text). Optional: state, timeoutMs (default 8000, max 20000). See SandboxEphemeralDto and CreateSandboxSessionDto in the API reference.

SDK

Durable sessions: sandbox.createSession / create_session, execute, getSession / get_session, releaseSession / release_session.
  • Tools — Create custom tools after a successful sandbox preview
  • Browser sessions — Live browser runtime (separate from code sandbox)