# E2b

Open-source Code Interpreting for AI Apps. Run sandboxed code execution environments with support for multiple programming languages.

- **Category:** developer tools
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 27
- **Triggers:** 0
- **Slug:** `E2B`
- **Version:** 00000000_00

## Tools

### Connect to Sandbox

**Slug:** `E2B_CONNECT_SANDBOX`

Tool to connect to an existing E2B sandbox and retrieve its details. Use when you need to reconnect to a sandbox from different environments or resume a paused sandbox. The TTL is extended upon connection.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `timeout` | integer | No | Timeout in seconds for the sandbox connection. Maximum 86400 seconds (24 hours) for Pro users, 3600 seconds (1 hour) for Hobby users. Default is 300 seconds (5 minutes). |
| `sandbox_id` | string | Yes | The unique identifier of the sandbox to connect to. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Template

**Slug:** `E2B_CREATE_TEMPLATE`

Tool to create a new E2B template with specified configuration. Use when you need to define a new sandbox template that can be used to spawn sandbox environments.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `alias` | string | Yes | Unique identifier for the template. This is a human-readable name used to reference the template. |
| `cpuCount` | integer | No | Number of CPU cores to allocate to sandboxes using this template. |
| `memoryMB` | integer | No | Amount of memory in megabytes to allocate to sandboxes using this template. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Webhook

**Slug:** `E2B_CREATE_WEBHOOK`

Tool to register a new webhook to receive sandbox lifecycle events for the team. Use when you need to set up notifications for sandbox lifecycle events such as creation, updates, or termination.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | Yes | HTTPS endpoint where webhook events will be delivered. Must be a valid HTTPS URL. |
| `name` | string | Yes | Human-readable identifier for the webhook. |
| `events` | array | Yes | List of event types to subscribe to. Valid values: 'sandbox.lifecycle.created', 'sandbox.lifecycle.updated', 'sandbox.lifecycle.killed', 'sandbox.lifecycle.paused', 'sandbox.lifecycle.resumed'. |
| `enabled` | boolean | Yes | Whether the webhook actively receives events. |
| `signatureSecret` | string | Yes | Secret key used to verify webhook authenticity via HMAC signatures. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete Sandbox

**Slug:** `E2B_DELETE_SANDBOXES`

Tool to terminate and permanently delete a running E2B sandbox instance. Use when you need to kill a sandbox that is no longer needed. Once terminated, the sandbox cannot be resumed.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `sandbox_id` | string | Yes | The unique identifier of the sandbox to terminate. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete Webhook

**Slug:** `E2B_DELETE_WEBHOOK`

Tool to unregister a webhook and stop receiving lifecycle events. Use when you need to remove a webhook that is no longer needed or to clean up webhook registrations.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `webhook_id` | string | Yes | The unique identifier of the webhook to delete. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Check API Health

**Slug:** `E2B_GET_HEALTH`

Tool to check the health status of the E2B API. Use when you need to verify that the API service is operational and accessible.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Sandbox

**Slug:** `E2B_GET_SANDBOX`

Tool to retrieve detailed information about a specific sandbox by its ID. Use when you need to check sandbox status, metadata, or configuration details.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `sandbox_id` | string | Yes | The unique identifier of the sandbox to retrieve. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Sandbox Logs

**Slug:** `E2B_GET_SANDBOXES_LOGS`

Tool to retrieve logs from a specific E2B sandbox instance. Use when you need to debug or monitor sandbox execution by viewing its console output and system logs.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `sandbox_id` | string | Yes | The unique identifier of the sandbox to retrieve logs for. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Sandbox Lifecycle Events

**Slug:** `E2B_GET_SANDBOX_LIFECYCLE_EVENTS`

Tool to retrieve the latest lifecycle events for a particular sandbox instance. Use when you need to track state changes including creation, pausing, resuming, updates, and termination of a sandbox.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Number of events to return. Default is 10, minimum is 1, maximum is 100. |
| `offset` | integer | No | Number of events to skip from the beginning. Default is 0. |
| `orderAsc` | boolean | No | Sort direction—true for ascending chronological order, false for descending (default: false). |
| `sandbox_id` | string | Yes | The unique identifier of the sandbox to retrieve events for. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Sandbox Metrics

**Slug:** `E2B_GET_SANDBOX_METRICS`

Tool to retrieve timestamped CPU, memory, and disk usage metrics for a sandbox. Use when you need to monitor resource usage of a running sandbox. Metrics are collected every 5 seconds; returns empty array if no metrics available yet.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `end` | integer | No | End timestamp for metrics filtering (Unix timestamp in seconds). |
| `start` | integer | No | Start timestamp for metrics filtering (Unix timestamp in seconds). |
| `sandbox_id` | string | Yes | The unique identifier of the sandbox to retrieve metrics for. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Team Metrics

**Slug:** `E2B_GET_TEAMS_METRICS`

Tool to retrieve timestamped CPU, memory, and disk usage metrics for a team. Use when you need to monitor aggregated resource usage across all sandboxes belonging to a team.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `end` | integer | No | End timestamp for metrics filtering (Unix timestamp in seconds). |
| `start` | integer | No | Start timestamp for metrics filtering (Unix timestamp in seconds). |
| `team_id` | string | Yes | The unique identifier of the team to retrieve metrics for. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Team Maximum Metrics

**Slug:** `E2B_GET_TEAMS_METRICS_MAX`

Tool to retrieve the maximum value for a specific team metric in a given interval. Use when you need to check team limits or peak usage, such as maximum concurrent sandboxes allowed or highest resource usage.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `end` | integer | No | End timestamp for metrics filtering as Unix timestamp (seconds since epoch). If provided, returns maximum in the specified interval. |
| `start` | integer | No | Start timestamp for metrics filtering as Unix timestamp (seconds since epoch). If provided, returns maximum in the specified interval. |
| `metric` | string | Yes | The metric type to retrieve the maximum value for. Allowed values are 'concurrent_sandboxes' for maximum concurrent sandbox limit or 'sandbox_start_rate' for sandbox start rate. |
| `team_id` | string | Yes | The unique identifier of the team to retrieve maximum metrics for. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Template Build Status

**Slug:** `E2B_GET_TEMPLATES_BUILD_STATUS`

Tool to get the status of a template build. Use when you need to check the build status of a template that was started asynchronously. Useful in polling loops to monitor template builds in progress.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `buildID` | string | Yes | The unique identifier of the specific build. |
| `logsOffset` | integer | No | Offset for fetching logs from a specific point. Used to retrieve logs incrementally without re-fetching previous entries. Defaults to 0. |
| `templateID` | string | Yes | The unique identifier of the template. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Template Files

**Slug:** `E2B_GET_TEMPLATES_FILES`

Tool to get an upload link for a tar file containing build layer files. Use when you need to retrieve or download template build layer files by their hash.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `hash` | string | Yes | The hash of the build layer files to retrieve. |
| `templateID` | string | Yes | The unique identifier of the template. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Webhook Configuration

**Slug:** `E2B_GET_WEBHOOK`

Tool to retrieve the current webhook configuration for a specific webhook. Use when you need to inspect webhook settings, verify configuration, or check webhook status.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `webhook_id` | string | Yes | The unique identifier of the webhook to retrieve. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List All Sandboxes

**Slug:** `E2B_LIST_SANDBOXES`

Tool to list all running and paused sandboxes associated with your team. Use when you need to view active sandboxes, monitor sandbox state, or retrieve sandbox identifiers for further operations. Supports pagination and filtering by state or metadata.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Number of items per page. Must be between 1 and 100. Default is 100. |
| `state` | array | No | Filter by sandbox state. Accepts 'running' and/or 'paused'. Multiple states are combined with AND logic. |
| `metadata` | object | No | Key-value pairs to filter sandboxes by metadata set during creation. Multiple filters are combined with AND logic. |
| `nextToken` | string | No | Base64-encoded pagination token for fetching the next page of results. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Sandboxes Metrics

**Slug:** `E2B_LIST_SANDBOXES_METRICS`

Tool to retrieve timestamped CPU, memory, and disk usage metrics for multiple sandboxes. Use when you need to monitor resource usage across multiple sandboxes simultaneously. Metrics are collected every 5 seconds; returns empty array if no metrics available yet.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `end` | string | No | End timestamp for metrics filtering (ISO 8601 format). |
| `start` | string | No | Start timestamp for metrics filtering (ISO 8601 format). |
| `sandbox_ids` | array | Yes | List of sandbox IDs to retrieve metrics for. Provide one or more sandbox identifiers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Team Sandbox Lifecycle Events

**Slug:** `E2B_LIST_TEAM_SANDBOX_LIFECYCLE_EVENTS`

Tool to retrieve the latest lifecycle events across all sandboxes associated with the team. Use when you need to monitor sandbox activity, track lifecycle changes, or audit sandbox operations.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Number of events to return. Must be between 1 and 100. Default is 10. |
| `offset` | integer | No | Number of events to skip for pagination. Must be non-negative. Default is 0. |
| `orderAsc` | boolean | No | Sort order for events. True for ascending (oldest first), false for descending (newest first). Default is false. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List All Templates

**Slug:** `E2B_LIST_TEMPLATES`

Tool to list all available E2B templates for your team. Use when you need to view available templates, retrieve template identifiers, or audit template configurations.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List All Webhooks

**Slug:** `E2B_LIST_WEBHOOKS`

Tool to retrieve all registered webhooks for your team. Use when you need to view all webhook configurations, audit webhook settings, or manage multiple webhooks.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Pause Sandbox

**Slug:** `E2B_PAUSE_SANDBOX`

Tool to pause a running E2B sandbox preserving its filesystem and memory state. Use when you need to temporarily suspend a sandbox while maintaining its state for later resumption. Takes approximately 4 seconds per 1 GiB of RAM to pause. Paused sandboxes can be stored for up to 30 days.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `sandbox_id` | string | Yes | The unique identifier of the sandbox to pause. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Sandbox

**Slug:** `E2B_POST_SANDBOXES`

Tool to create a new E2B sandbox from a template. Use when you need to launch a fresh sandbox environment for code execution, testing, or development purposes.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `envs` | object | No | Custom environment variables for the sandbox as key-value pairs. These will be available inside the sandbox environment. |
| `timeout` | integer | No | Timeout value in seconds for the sandbox session. Maximum is 86400 (24 hours) for Pro plan, 3600 (1 hour) for Hobby plan. Default is 300 seconds if not specified. |
| `metadata` | object | No | Custom metadata key-value pairs for the sandbox. Use for tracking purpose, owner, or any other custom attributes. |
| `autoPause` | boolean | No | Enable automatic pausing of the sandbox when inactive to save resources. |
| `templateID` | string | Yes | The ID of the template to use for creating the sandbox. This identifies which preconfigured environment to launch. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Set Sandbox Timeout

**Slug:** `E2B_POST_SANDBOXES_TIMEOUT`

Tool to set the timeout for an E2B sandbox. Use when you need to extend or reduce the sandbox lifetime. The timeout is measured from the current time, and calling this multiple times overwrites the previous TTL.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `timeout` | integer | Yes | Timeout duration in seconds from the time of this request. Minimum is 1 second. Maximum is 86400 seconds (24 hours) for Pro users, 3600 seconds (1 hour) for Hobby users. Calling this method multiple times overwrites the TTL, each time using the current timestamp as the starting point. |
| `sandbox_id` | string | Yes | The unique identifier of the sandbox to update the timeout for. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Refresh Sandbox

**Slug:** `E2B_REFRESH_SANDBOX`

Tool to refresh an E2B sandbox and extend its time to live. Use when you need to keep a sandbox alive longer and prevent it from timing out.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `sandbox_id` | string | Yes | The unique identifier of the sandbox to refresh and extend its TTL. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Start Template Build

**Slug:** `E2B_START_TEMPLATE_BUILD`

Tool to start a build for an E2B template. Use when you need to initiate the build process for a template with specific configuration. The build runs asynchronously and returns immediately with a 202 Accepted status.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `force` | boolean | No | Whether the whole build should be forced to run regardless of the cache. |
| `steps` | array | No | List of steps to execute in the template build. Each step defines an operation to perform during the build process. |
| `buildID` | string | Yes | Identifier of the build to start. |
| `readyCmd` | string | No | Ready check command to execute in the template after the build to verify readiness. |
| `startCmd` | string | No | Command to execute in the template after the build completes. |
| `fromImage` | string | No | Base image to use for the template build. Specify either fromImage or fromTemplate, not both. |
| `templateID` | string | Yes | Identifier of the template to build. |
| `fromTemplate` | string | No | Base template to use for the template build. Specify either fromImage or fromTemplate, not both. |
| `fromImageRegistry` | object | No | Registry authentication configuration for pulling base images. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Template

**Slug:** `E2B_UPDATE_TEMPLATE`

Tool to update an E2B template configuration. Use when you need to modify template settings such as changing visibility (public/private status).

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `public` | boolean | No | Whether the template should be publicly accessible. If true, the template can be used by anyone; if false, it remains private to the team. |
| `template_id` | string | Yes | The unique identifier of the template to update. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Webhook Configuration

**Slug:** `E2B_UPDATE_WEBHOOK`

Tool to update an existing webhook configuration including URL, enabled status, and subscribed events. Use when you need to modify webhook settings, change the destination URL, enable/disable a webhook, or update event subscriptions.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | No | The webhook endpoint URL to receive event notifications. If provided, replaces the previous URL. |
| `events` | array | No | List of event types to subscribe to. Available events: 'sandbox.lifecycle.created' (sandbox creation), 'sandbox.lifecycle.killed' (sandbox termination), 'sandbox.lifecycle.updated' (sandbox configuration updates), 'sandbox.lifecycle.paused' (sandbox pausing), 'sandbox.lifecycle.resumed' (sandbox resuming). |
| `enabled` | boolean | No | Whether the webhook is active. If true, webhook will send notifications; if false, webhook is disabled. |
| `webhook_id` | string | Yes | The unique identifier of the webhook to update. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
