> ## Documentation Index
> Fetch the complete documentation index at: https://novita.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Legacy SDKs & CLI

<Warning>
  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.
</Warning>

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

<CodeGroup>
  ```bash JavaScript & TypeScript icon="terminal" theme={"system"}
  npm i novita-sandbox@1.0.2
  ```

  ```bash Python icon="terminal" theme={"system"}
  pip install novita-sandbox==1.0.5
  ```
</CodeGroup>

### Install Legacy Stable CLI

<CodeGroup>
  ```bash Bash icon="terminal" theme={"system"}
  npm i -g novita-sandbox-cli@1.0.4
  ```
</CodeGroup>

### Install Legacy Beta SDK

<CodeGroup>
  ```bash JavaScript & TypeScript icon="terminal" theme={"system"}
  npm i novita-sandbox@1.2.3b1
  ```

  ```bash Python icon="terminal" theme={"system"}
  pip install novita-sandbox==1.2.5b2
  ```
</CodeGroup>

### Install Legacy Beta CLI

<CodeGroup>
  ```bash Bash icon="terminal" theme={"system"}
  npm i -g novita-sandbox-cli@1.2.3b1
  ```
</CodeGroup>

## Setup Configuration

Legacy SDK versions use `sandbox.novita.ai` by default. You only need to configure your Novita API key.

```bash Bash icon="terminal" theme={"system"}
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.

<CodeGroup>
  ```js JavaScript & TypeScript icon="js" theme={"system"}
  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()
  ```

  ```python Python icon="python" theme={"system"}
  from novita_sandbox.code_interpreter import Sandbox

  sbx = Sandbox.create()
  execution = sbx.commands.run('ls -l')
  print(execution)

  sbx.kill()
  ```
</CodeGroup>

Below is an example showing how to use the Novita Sandbox CLI.

<CodeGroup>
  ```bash Bash icon="terminal" theme={"system"}
  # 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>
  ```
</CodeGroup>
