This legacy page is kept for users who still use the 1.x or beta SDK line. New SDK 2.x integrations should follow the current Sandbox documentation.
This page lists the legacy Novita Agent Sandbox SDK and CLI versions for users who still need the 1.x stable or 1.x beta SDK line.
Legacy Novita SDK Versions
If you need to stay on the legacy 1.x SDK line, pin one of the following versions explicitly:
| Package | Last 1.x stable version | Last 1.x beta version |
|---|
| Python SDK | novita-sandbox==1.0.5 | novita-sandbox==1.2.5b2 |
| JavaScript/TypeScript SDK | novita-sandbox@1.0.2 | novita-sandbox@1.2.3b1 |
| CLI | novita-sandbox-cli@1.0.4 | novita-sandbox-cli@1.2.3b1 |
Installation
Install Legacy Stable SDK
npm i novita-sandbox@1.0.2
Install Legacy Stable CLI
npm i -g novita-sandbox-cli@1.0.4
Install Legacy Beta SDK
npm i novita-sandbox@1.2.3b1
Install Legacy Beta CLI
npm i -g novita-sandbox-cli@1.2.3b1
Setup Configuration
Legacy SDK versions use sandbox.novita.ai by default. You only need to configure your Novita API key.
export NOVITA_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.
import { Sandbox } from 'novita-sandbox/code-interpreter'
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 Novita Sandbox CLI.
# Authentication in CLI
novita-sandbox-cli auth login
# Start sandbox and connect to terminal
novita-sandbox-cli sandbox spawn <template-id>
# List sandboxes
novita-sandbox-cli sandbox list
# Shutdown running sandboxes
novita-sandbox-cli sandbox kill <sandbox-id>