Skip to main content
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.
CoreWeave sandboxes are in public preview. For access, contact your CoreWeave account team, CoreWeave Support, or email support@coreweave.com.

Installation

uv pip install cwsandbox

Quick start

Create a sandbox, run a command, and retrieve the result:
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:
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

Get started

End-to-end walkthrough from creating a profile and deploying a runner to running your first sandbox from the SDK.

Tutorial

Step-by-step walkthrough of configuration, command execution, file operations, and cleanup with the SDK.

Guides

In-depth guides about specific topics including lifecycle management, file operations, execution patterns, and troubleshooting.
Last modified on June 4, 2026