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

# Sandbox Python client

> Python SDK for creating and managing CoreWeave sandbox environments.

The `cwsandbox` Python client provides a high-level SDK for creating and managing CoreWeave sandbox environments. It supports both synchronous and asynchronous workflows through a unified API.

<Note>
  CoreWeave sandboxes are in public preview. For access, contact your CoreWeave account team, [CoreWeave Support](https://cloud.coreweave.com/contact), or email [support@coreweave.com](mailto:support@coreweave.com).
</Note>

## Installation

```bash theme={"system"}
uv pip install cwsandbox
```

## Quick start

Create a sandbox, run a command, and retrieve the result:

```python theme={"system"}
from cwsandbox import Sandbox

# Context manager for automatic cleanup
with Sandbox.run(container_image="python:3.11") as sb:
    result = sb.exec(["python", "-c", "print(2 + 2)"]).result()
    print(result.stdout)  # 4
```

The same API works in async contexts:

```python theme={"system"}
from cwsandbox import Sandbox

async with Sandbox.run() as sb:
    result = await sb.exec(["python", "-c", "print(2 + 2)"])
    print(result.stdout)  # 4
```

## Next steps

<CardGroup cols={3}>
  <Card title="Get started" icon="rocket" href="/products/sandboxes/get-started">
    End-to-end walkthrough from creating a profile and deploying a runner to running your first sandbox from the SDK.
  </Card>

  <Card title="Tutorial" icon="graduation-cap" href="/products/sandboxes/client/tutorial/configuration">
    Step-by-step walkthrough of configuration, command execution, file operations, and cleanup with the SDK.
  </Card>

  <Card title="Guides" icon="book" href="/products/sandboxes/client/guides/sandbox-lifecycle">
    In-depth guides about specific topics including lifecycle management, file operations, execution patterns, and troubleshooting.
  </Card>
</CardGroup>
