Novita Agent Sandbox provides a compatibility API that allows you to use the E2B SDK and CLI. This is useful if you are already using the E2B SDK and CLI and want to switch to Novita Agent Sandbox. However, we recommend using the Novita Agent Sandbox SDK to access all features.

Installation

Code Interpreter SDK

npm i @e2b/code-interpreter@beta

Core SDK

npm i e2b@beta

Desktop SDK

npm i @e2b/desktop@beta

CLI

npm i -g @e2b/cli@v1.9.2

Setup Configuration

You need to set the following environment variables in your project to use the E2B SDK and CLI with Novita Agent Sandbox.
Bash
export E2B_DOMAIN=sandbox.novita.ai
export E2B_API_KEY="<Your Novita AI API Key>"

Examples

Below is an example showing how to create a sandbox through the SDK and run specified commands using E2B SDK.
import { Sandbox } from '@e2b/code-interpreter'
// or import { Sandbox } from 'e2b'
// or import { Sandbox } from '@e2b/desktop'

const sbx = await Sandbox.create()
const execution = await sbx.commands.run('ls -l')
console.log(execution)

await sbx.kill()
Below is an example showing how to use the E2B CLI with Novita Agent Sandbox.
export E2B_DOMAIN=sandbox.novita.ai
# Authentication in CLI
e2b auth login

# Start sandbox and connect to terminal
e2b sandbox spawn <template-id>

# List sandboxes
e2b sandbox list

# Shutdown running sandboxes
e2b sandbox kill <sandbox-id>