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

# Python SDK

> Use run.cloud from Python and migrate common sandbox SDK integrations.

Install the native Python client and its compatibility adapters from PyPI:

```bash theme={null}
pip install runcloud-sdk
runcloud login
```

```python theme={null}
from runcloud import Client

cloud = Client()
box = cloud.create(image="runcloud/agent-base", cpu=2, memory=4096)
try:
    result = box.exec("python -V")
    print(result.stdout)
finally:
    box.destroy()
```

`Client()` automatically uses the credential saved by `runcloud login`. For
automation, set `RUN_CLOUD_API_KEY` and optionally `RUN_CLOUD_API_URL`, or pass
`api_key` and `api_url` directly. The client also accepts
`RUN_CLOUD_API_TOKEN` as an alias for `RUN_CLOUD_API_KEY`.

## Compatibility adapters

| Provider       | Import                                                   |
| -------------- | -------------------------------------------------------- |
| Modal          | `from runcloud.compat import modal`                      |
| E2B            | `from runcloud.compat.e2b import Sandbox`                |
| Daytona        | `from runcloud.compat.daytona import Daytona`            |
| Vercel Sandbox | `from runcloud.compat.vercel import Sandbox`             |
| Blaxel async   | `from runcloud.compat.blaxel import SandboxInstance`     |
| Blaxel sync    | `from runcloud.compat.blaxel import SyncSandboxInstance` |
| Fly Sprites    | `from runcloud.compat.sprites import SpritesClient`      |

```python theme={null}
# from e2b import Sandbox
from runcloud.compat.e2b import Sandbox

box = Sandbox.create()
try:
    result = box.commands.run("python -V")
    print(result.stdout)
finally:
    box.kill()
```

The adapters cover core creation, lookup, commands, lifecycle, and destruction.
Blaxel's current `SandboxInstance` API is async; use `SyncSandboxInstance` when
migrating its synchronous API. Provider-specific functionality without a public
run.cloud equivalent raises `UnsupportedCompatibilityFeatureError` with a
migration hint. The adapters do not report a fabricated success for unsupported
features.
