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

# Sandbox

> A sandbox: an image with volumes, running its command until deleted.

```python theme={null}
class Sandbox
```

`exec` runs processes in it once it runs.

```python theme={null}
Sandbox(client: _control_plane.OuterProductClient, resource: _control_plane.Sandbox)
```

```python theme={null}
name: str
status: SandboxStatus
error: str | None
exit_code: int | None
created_by: str
labels: dict[str, str]
port: int | None
url: str
```

## `refresh`

<sub>method</sub>

```python theme={null}
def refresh() -> Sandbox
```

## `wait`

<sub>method</sub>

```python theme={null}
def wait() -> int | None
```

Wait for its command to end, and return its exit code.

## `exec`

<sub>method</sub>

```python theme={null}
def exec(
    *args: str = (),
    env: dict[str, str] | None = None,
    workdir: str | None = None,
    pty: tuple[int, int] | None = None,
) -> SandboxProcess
```

Run `args` once the sandbox runs.

`pty`, as `(rows, columns)`, runs it on a terminal whose output
reads as stdout. The process is killed once its handle is dropped.

## `terminate`

<sub>method</sub>

```python theme={null}
def terminate() -> None
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.