Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 41 additions & 40 deletions docs.mdx
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
---
title: "E2B Documentation"
sidebarTitle: Home
icon: house
---

import { Concepts } from '/snippets/Concepts.jsx';
import { CodeInterpreting } from '/snippets/CodeInterpreting.jsx';
import { Quickstart } from '/snippets/Quickstart.jsx';

Here you'll find all the guides, concepts, and SDK references for developing with E2B.

<CodeGroup>
```bash JavaScript & TypeScript
npm i @e2b/code-interpreter
```
```bash Python
pip install e2b-code-interpreter
```
</CodeGroup>

## What is E2B?
E2B is an [open-source](https://github.com/e2b-dev) infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud.
To start and control sandboxes, use our [Python SDK](https://pypi.org/project/e2b/) or [JavaScript SDK](https://www.npmjs.com/package/e2b).

Some of the typical use cases for E2B are AI data analysis or visualization, running AI-generated code of various languages, playground for coding agents, environment for codegen evals, or running full AI-generated apps like in [Fragments](https://github.com/e2b-dev/fragments).

### Under the hood
The E2B Sandbox is a small isolated VM the can be started very quickly (~150ms). You can think of it as a small computer for the AI model. You can run many sandboxes at once. Typically, you run separate sandbox for each LLM, user, or AI agent session in your app.
For example, if you were building an AI data analysis chatbot, you would start the sandbox for every user session.

## Quickstart
<Quickstart/>

## Code interpreting with AI
<CodeInterpreting/>

## Learn the core concepts
<Concepts/>

---
title: "E2B Documentation - AI Sandbox Infrastructure"
description: "Complete Guides, Concepts, And SDK References For Developing With E2B's Secure Cloud Sandboxes For AI-Generated Code Execution And Data Analysis."
sidebarTitle: Home
icon: house
---

import { Concepts } from '/snippets/Concepts.jsx';
import { CodeInterpreting } from '/snippets/CodeInterpreting.jsx';
import { Quickstart } from '/snippets/Quickstart.jsx';

Here you'll find all the guides, concepts, and SDK references for developing with E2B.

<CodeGroup>
```bash JavaScript & TypeScript
npm i @e2b/code-interpreter
```
```bash Python
pip install e2b-code-interpreter
```
</CodeGroup>

## What is E2B?
E2B is an [open-source](https://github.com/e2b-dev) infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud.
To start and control sandboxes, use our [Python SDK](https://pypi.org/project/e2b/) or [JavaScript SDK](https://www.npmjs.com/package/e2b).

Some of the typical use cases for E2B are AI data analysis or visualization, running AI-generated code of various languages, playground for coding agents, environment for codegen evals, or running full AI-generated apps like in [Fragments](https://github.com/e2b-dev/fragments).

Check warning on line 27 in docs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs.mdx#L27

Did you really mean 'codegen'?

Check warning on line 27 in docs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs.mdx#L27

Did you really mean 'evals'?

### Under the hood
The E2B Sandbox is a small isolated VM the can be started very quickly (~150ms). You can think of it as a small computer for the AI model. You can run many sandboxes at once. Typically, you run separate sandbox for each LLM, user, or AI agent session in your app.
For example, if you were building an AI data analysis chatbot, you would start the sandbox for every user session.

Check warning on line 31 in docs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs.mdx#L31

Did you really mean 'chatbot'?

## Quickstart
<Quickstart/>

## Code interpreting with AI
<CodeInterpreting/>

## Learn the core concepts
<Concepts/>

83 changes: 42 additions & 41 deletions docs/api-key.mdx
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
---
title: "API Key"
icon: "key"
---

To use the API key, you can either:

- **Set the API key as the `E2B_API_KEY` environment variable** to avoid passing it each time you create a sandbox.
- Or pass it directly to the `Sandbox` constructor as shown below:

<CodeGroup>
```js JavaScript & TypeScript
import { Sandbox } from '@e2b/code-interpreter'

const sandbox = await Sandbox.create({ apiKey: 'YOUR_API_KEY' })
```
```python Python
from e2b_code_interpreter import Sandbox

sbx = Sandbox.create(api_key="YOUR_API_KEY")
```
</CodeGroup>

## Where to find API key

You can get your API key at [dashboard](https://e2b.dev/dashboard?tab=keys).

<br/>

# Access Token

The access token is used only in the CLI and is **not needed in the SDK**. There's no need to set it when logging into the CLI using `e2b auth login`.

<Note>
To authenticate without the browser, you can set `E2B_ACCESS_TOKEN` as an environment variable. This is useful for CI/CD pipelines.
</Note>

## Where to find Access token

You can get your **Access token key** at the [dashboard](https://e2b.dev/dashboard/account).

---
title: "API Key Authentication For E2B Sandboxes"
description: "Learn How To Set Up And Use E2B API Keys For Sandbox Authentication, Including Environment Variables And Direct Constructor Methods For Secure Access."
icon: "key"
---

To use the API key, you can either:

- **Set the API key as the `E2B_API_KEY` environment variable** to avoid passing it each time you create a sandbox.
- Or pass it directly to the `Sandbox` constructor as shown below:

<CodeGroup>
```js JavaScript & TypeScript
import { Sandbox } from '@e2b/code-interpreter'

const sandbox = await Sandbox.create({ apiKey: 'YOUR_API_KEY' })

Check warning on line 16 in docs/api-key.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/api-key.mdx#L16

Did you really mean 'apiKey'?
```
```python Python
from e2b_code_interpreter import Sandbox

sbx = Sandbox.create(api_key="YOUR_API_KEY")
```
</CodeGroup>

## Where to find API key

You can get your API key at [dashboard](https://e2b.dev/dashboard?tab=keys).

<br/>

# Access Token

The access token is used only in the CLI and is **not needed in the SDK**. There's no need to set it when logging into the CLI using `e2b auth login`.

<Note>
To authenticate without the browser, you can set `E2B_ACCESS_TOKEN` as an environment variable. This is useful for CI/CD pipelines.
</Note>

## Where to find Access token

You can get your **Access token key** at the [dashboard](https://e2b.dev/dashboard/account).

141 changes: 71 additions & 70 deletions docs/byoc.mdx
Original file line number Diff line number Diff line change
@@ -1,70 +1,71 @@
---
title: "BYOC (Bring Your Own Cloud)"
sidebarTitle: Bring Your Own Cloud
---

BYOC (Bring Your Own Cloud) allows you to deploy E2B sandboxes to your own cloud infrastructure within your VPC.

BYOC is currently only available for AWS. We are working on adding support for Google Cloud and Azure.

<Note>
BYOC is offered to enterprise customers only.
If you’re interested in BYOC offering, please book a call with our team [here](https://e2b.dev/contact) or contact us at [enterprise@e2b.dev](mailto:enterprise@e2b.dev).
</Note>

## Architecture

Sandbox templates, snapshots, and runtime logs are stored within the customer's BYOC VPC.
Anonymized system metrics such as cluster memory and cpu are sent to the E2B Cloud for observability and cluster management purposes.

All potentially sensitive traffic, such as sandbox template build source files,
sandbox traffic, and logs, is transmitted directly from the client to the customer's BYOC VPC without ever touching the E2B Cloud infrastructure.

### Glossary
- **BYOC VPC**: The customer's Virtual Private Network where the E2B sandboxes are deployed. For example your AWS account.
- **E2B Cloud**: The managed service that provides the E2B platform, observability and cluster management.
- **OAuth Provider**: Customer-managed service that provides user and E2B Cloud with access to the cluster.

<Frame>
<img src="/images/byoc-architecture-diagram.png" />
</Frame>

### BYOC Cluster Components
- **Orchestrator**: Represents a node that is responsible for managing sandboxes and their lifecycle. Optionally, it can also run the template builder component.
- **Edge Controller**: Routes traffic to sandboxes, exposes API for cluster management, and gRPC proxy used by E2B control plane to communicate with orchestrators.
- **Monitoring**: Collector that receives sandbox and build logs and system metrics from orchestrators and edge controllers. Only anonymized metrics are sent to the E2B Cloud for observability purposes.
- **Storage**: Persistent storage for sandbox templates, snapshots, and runtime logs. Image container repository for template images.

## Onboarding

Customers can initiate the onboarding process by reaching out to us.
Customers need to have a dedicated AWS account and know the region they will use.
After that, we will receive the IAM role needed for managing account resources.
For AWS account quota limits may need to be increased.

Terraform configuration and machine images will be used for provisioning BYOC cluster.
When provisioning is done and running, we will create a new team under your E2B account that can be used by SDK/CLI the same way as it is hosted on E2B Cloud.

## FAQ

<AccordionGroup>
<Accordion title="How Is Cluster Monitored?">
Cluster is forwarding anonymized metrics such as machine cpu/memory usage to E2B Control plane for advanced observability and alerting.
The whole observability stack is anonymized and does not contain any sensitive information.
</Accordion>
<Accordion title="Can cluster automatically scale?">
A cluster can be scaled horizontally by adding more orchestrators and edge controllers.
The autoscaler is currently in V1 not capable of automatically scale orchestrator nodes that are needed for sandbox spawning.
This feature is coming in the next versions.
</Accordion>
<Accordion title="Are sandboxes accessible only from a customer’s private network?">
Yes. Load balancer that is handling all requests coming to sandbox can be configured as internal and VPC peering
with additional customer’s VPC can be configured so sandbox traffic can stay in the private network.
</Accordion>
<Accordion title="How control plane secure communication is ensured?">
Data sent between the E2B Cloud and your BYOC VPC is encrypted using TLS.

VPC peering can be established to allow direct communication between the E2B Cloud and your BYOC VPC.
When using VPC peering, the load balancer can be configured as private without a public IP address.
</Accordion>
</AccordionGroup>
---
title: "BYOC - Deploy E2B Sandboxes In Your Cloud"
description: "Deploy E2B Sandboxes To Your Own AWS Infrastructure Within Your VPC. Enterprise-Grade Security With Full Control Over Data And Compliance Requirements."
sidebarTitle: Bring Your Own Cloud
---

BYOC (Bring Your Own Cloud) allows you to deploy E2B sandboxes to your own cloud infrastructure within your VPC.

BYOC is currently only available for AWS. We are working on adding support for Google Cloud and Azure.

<Note>
BYOC is offered to enterprise customers only.
If you're interested in BYOC offering, please book a call with our team [here](https://e2b.dev/contact) or contact us at [enterprise@e2b.dev](mailto:enterprise@e2b.dev).
</Note>

## Architecture

Sandbox templates, snapshots, and runtime logs are stored within the customer's BYOC VPC.
Anonymized system metrics such as cluster memory and cpu are sent to the E2B Cloud for observability and cluster management purposes.

Check warning on line 19 in docs/byoc.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/byoc.mdx#L19

Did you really mean 'Anonymized'?

Check warning on line 19 in docs/byoc.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/byoc.mdx#L19

Did you really mean 'cpu'?

All potentially sensitive traffic, such as sandbox template build source files,
sandbox traffic, and logs, is transmitted directly from the client to the customer's BYOC VPC without ever touching the E2B Cloud infrastructure.

### Glossary
- **BYOC VPC**: The customer's Virtual Private Network where the E2B sandboxes are deployed. For example your AWS account.
- **E2B Cloud**: The managed service that provides the E2B platform, observability and cluster management.
- **OAuth Provider**: Customer-managed service that provides user and E2B Cloud with access to the cluster.

<Frame>
<img src="/images/byoc-architecture-diagram.png" />
</Frame>

### BYOC Cluster Components
- **Orchestrator**: Represents a node that is responsible for managing sandboxes and their lifecycle. Optionally, it can also run the template builder component.
- **Edge Controller**: Routes traffic to sandboxes, exposes API for cluster management, and gRPC proxy used by E2B control plane to communicate with orchestrators.
- **Monitoring**: Collector that receives sandbox and build logs and system metrics from orchestrators and edge controllers. Only anonymized metrics are sent to the E2B Cloud for observability purposes.

Check warning on line 36 in docs/byoc.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/byoc.mdx#L36

Did you really mean 'anonymized'?
- **Storage**: Persistent storage for sandbox templates, snapshots, and runtime logs. Image container repository for template images.

## Onboarding

Customers can initiate the onboarding process by reaching out to us.
Customers need to have a dedicated AWS account and know the region they will use.
After that, we will receive the IAM role needed for managing account resources.
For AWS account quota limits may need to be increased.

Terraform configuration and machine images will be used for provisioning BYOC cluster.
When provisioning is done and running, we will create a new team under your E2B account that can be used by SDK/CLI the same way as it is hosted on E2B Cloud.

## FAQ

<AccordionGroup>
<Accordion title="How Is Cluster Monitored?">
Cluster is forwarding anonymized metrics such as machine cpu/memory usage to E2B Control plane for advanced observability and alerting.

Check warning on line 53 in docs/byoc.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/byoc.mdx#L53

Did you really mean 'anonymized'?
The whole observability stack is anonymized and does not contain any sensitive information.

Check warning on line 54 in docs/byoc.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/byoc.mdx#L54

Did you really mean 'anonymized'?
</Accordion>
<Accordion title="Can cluster automatically scale?">
A cluster can be scaled horizontally by adding more orchestrators and edge controllers.
The autoscaler is currently in V1 not capable of automatically scale orchestrator nodes that are needed for sandbox spawning.

Check warning on line 58 in docs/byoc.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/byoc.mdx#L58

Did you really mean 'autoscaler'?
This feature is coming in the next versions.
</Accordion>
<Accordion title="Are sandboxes accessible only from a customer's private network?">
Yes. Load balancer that is handling all requests coming to sandbox can be configured as internal and VPC peering
with additional customer's VPC can be configured so sandbox traffic can stay in the private network.
</Accordion>
<Accordion title="How control plane secure communication is ensured?">
Data sent between the E2B Cloud and your BYOC VPC is encrypted using TLS.

VPC peering can be established to allow direct communication between the E2B Cloud and your BYOC VPC.
When using VPC peering, the load balancer can be configured as private without a public IP address.
</Accordion>
</AccordionGroup>
73 changes: 37 additions & 36 deletions docs/cli.mdx
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
---
title: "E2B CLI"
sidebarTitle: Installation
---

E2B CLI is a command line tool that allows you to list, kill running sandboxes, and manage [sandbox templates](/docs/template/quickstart).

## Installation

**Using Homebrew (on macOS)**

<CodeGroup>
```bash Terminal
brew install e2b
```
</CodeGroup>

**Using NPM**

You can install E2B CLI using the following command:

<CodeGroup>
```bash Terminal
npm i -g @e2b/cli
```
</CodeGroup>

### Beta CLI

The latest beta version of the CLI can be installed from NPM using the following command:

<CodeGroup>
```bash Terminal
npm i -g @e2b/cli@beta
```
</CodeGroup>
---
title: "E2B CLI - Command Line Tool For Sandboxes"
description: "Install And Use The E2B Command Line Interface To List, Kill Running Sandboxes, And Manage Custom Sandbox Templates With Homebrew Or NPM Installation."
sidebarTitle: Installation
---

E2B CLI is a command line tool that allows you to list, kill running sandboxes, and manage [sandbox templates](/docs/template/quickstart).

## Installation

**Using Homebrew (on macOS)**

<CodeGroup>
```bash Terminal
brew install e2b
```
</CodeGroup>

**Using NPM**

You can install E2B CLI using the following command:

<CodeGroup>
```bash Terminal
npm i -g @e2b/cli
```
</CodeGroup>

### Beta CLI

The latest beta version of the CLI can be installed from NPM using the following command:

<CodeGroup>
```bash Terminal
npm i -g @e2b/cli@beta
```
</CodeGroup>
Loading