# Create Your First Novita Agent Sandbox | Quickstart

> Quickstart guide to create a Novita Agent Sandbox for code execution, browser workflows, and AI agent tasks.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown is available with `Accept: text/markdown` and `.md` URL variants.

Source: /docs/guides/sandbox-your-first-agent-sandbox

# Create Your First Agent Sandbox

##

[​](#create-an-account)

Create an Account

If you don’t have a Novita account, [sign up](https://novita.ai/user/register) first. For details, please refer to [Quickstart guide](/docs/guides/quickstart).
New users can complete a quick account setup survey to claim $100 in free Sandbox credits. No credit card is required.

##

[​](#create-api-key)

Create API Key

Navigate to the Novita [Key Management page](https://novita.ai/settings/key-management), create an API key, and save the API key value for use in subsequent steps.

##

[​](#install-sdk)

Install SDK

You can install the Novita SDK by executing the following commands.

JavaScript & TypeScript SDK

Python SDK

```
npm i novita-sandbox
```

```
pip install novita-sandbox
```

##

[​](#configure-environment-variables)

Configure Environment Variables

Create a `.env` file in your project folder if it does not exist, and configure your API key.

For JavaScript and TypeScript projects, you need to import the `dotenv/config` package in your project; for Python projects, you need to import the `dotenv` library in your project and call the `load_dotenv` method to load environment variables.
For details, please refer to the [example](#use-sdk-to-start-agent-sandbox).

.env

```
NOVITA_API_KEY=sk_*** # Novita API key obtained from previous steps
```

Or you can configure the API key by setting an environment variable in your terminal.

Bash

```
export NOVITA_API_KEY=sk_*** # Novita API key obtained from previous steps
```

##

[​](#use-sdk-to-start-agent-sandbox)

Use SDK to Start Agent Sandbox

Below is a simple example showing how to create a sandbox, execute code inside it, and list files in the sandbox filesystem.

JavaScript & TypeScript

Python

```
// index.ts
import 'dotenv/config'
import { Sandbox } from 'novita-sandbox/code-interpreter'

// The .env file should be located in the project root directory
// dotenv/config will automatically look for .env in the current working directory
// Or
// You can set the environment variable in the command line
// export NOVITA_API_KEY=sk_***

async function main() {
const sandbox = await Sandbox.create()
try {
const execution = await sandbox.runCode('print("hello world")')
console.log(execution.logs)

const files = await sandbox.files.list('/tmp')
console.log(files)
} finally {
// Close sandbox when no longer needed
await sandbox.kill()
}
}
main().catch((err) => {
console.error(err)
process.exit(1)
})
```

```
# main.py
from dotenv import load_dotenv
from novita_sandbox.code_interpreter import Sandbox

# The .env file should be located in the project root directory
# dotenv will automatically look for .env in the current working directory
load_dotenv()

# Or
# You can set the environment variable in the command line
# export NOVITA_API_KEY=sk_***

sandbox = Sandbox.create()
execution = sandbox.run_code("print('hello world')")
print(execution.logs)

files = sandbox.files.list("/")
print(files)

# Close sandbox when no longer needed
sandbox.kill()
```

Execute the following commands to run the code.

index.ts

main.py

```
npx tsx ./index.ts
```

```
python main.py
```

Last modified on June 24, 2026
