# AsyncSandboxClient

> **Class** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient)

Async client for interacting with the Sandbox Server API.

This client provides an async interface for managing sandboxes and templates.

## Signature

```python
AsyncSandboxClient(
    self,
    *,
    api_endpoint: Optional[str] = None,
    timeout: float = 10.0,
    api_key: Optional[str] = None,
    max_retries: int = 3,
)
```

## Description

**Example:**

# Uses LANGSMITH_ENDPOINT and LANGSMITH_API_KEY from environment
async with AsyncSandboxClient() as client:
    # Create a sandbox and run commands
    async with await client.sandbox(template_name="python-sandbox") as sandbox:
        result = await sandbox.run("python --version")
        print(result.stdout)

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `api_endpoint` | `Optional[str]` | No | Full URL of the sandbox API endpoint. If not provided,           derived from LANGSMITH_ENDPOINT environment variable. (default: `None`) |
| `timeout` | `float` | No | Default HTTP timeout in seconds. (default: `10.0`) |
| `api_key` | `Optional[str]` | No | API key for authentication. If not provided, uses      LANGSMITH_API_KEY environment variable. (default: `None`) |
| `max_retries` | `int` | No | Maximum number of retries for transient errors (502, 503,          504), rate limits (429), and connection failures. Set to 0          to disable retries. Default: 3. (default: `3`) |

## Constructors

```python
__init__(
    self,
    *,
    api_endpoint: Optional[str] = None,
    timeout: float = 10.0,
    api_key: Optional[str] = None,
    max_retries: int = 3,
)
```

| Name | Type |
|------|------|
| `api_endpoint` | `Optional[str]` |
| `timeout` | `float` |
| `api_key` | `Optional[str]` |
| `max_retries` | `int` |


## Methods

- [`aclose()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/aclose)
- [`create_volume()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/create_volume)
- [`get_volume()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/get_volume)
- [`list_volumes()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/list_volumes)
- [`delete_volume()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/delete_volume)
- [`update_volume()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/update_volume)
- [`create_template()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/create_template)
- [`get_template()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/get_template)
- [`list_templates()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/list_templates)
- [`update_template()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/update_template)
- [`delete_template()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/delete_template)
- [`create_pool()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/create_pool)
- [`get_pool()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/get_pool)
- [`list_pools()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/list_pools)
- [`update_pool()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/update_pool)
- [`delete_pool()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/delete_pool)
- [`sandbox()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/sandbox)
- [`create_sandbox()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/create_sandbox)
- [`get_sandbox()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/get_sandbox)
- [`list_sandboxes()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/list_sandboxes)
- [`update_sandbox()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/update_sandbox)
- [`delete_sandbox()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/delete_sandbox)
- [`get_sandbox_status()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/get_sandbox_status)
- [`service()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/service)
- [`wait_for_sandbox()`](https://reference.langchain.com/python/langsmith/sandbox/_async_client/AsyncSandboxClient/wait_for_sandbox)

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/19dc497a3d89638e4cc35db72ea1c29cad35cbbf/python/langsmith/sandbox/_async_client.py#L60)