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

# Choose an interface

> Choose between the Python SDK, REST API, CLI, and MCP for a Sandboxes workflow.

All interfaces start from an image and create operations. Choose based on how the caller needs to submit, observe, and control work.

| Need | Start with | Reason |
| - | - | - |
| Python application or agent integration | Python SDK | Python objects for images, commands, and final results. |
| Integration in another language, live events, or additional process control | REST API | Exact request and status schemas, resumable SSE, and subprocess endpoints. |
| Manual image exploration and shell workflows | CLI | Local profiles, sessions, filesystem inspection, and command-oriented workflows. |
| Tool access from an MCP-compatible client | MCP | Tools for commands, images, files, and operation polling. |

## Capability map

The examples and method names on this page use Python SDK 0.3.6 and CLI 0.9.4. For MCP, check the tools exposed by the server connected to your client.

| Task | Python SDK 0.3.6 | REST API | CLI 0.9.4 | MCP |
| - | - | - | - | - |
| Run a command and wait for its result | Async `await image.run(...)`; sync `run(...).wait()` | Submit, then poll until the operation reaches a terminal state | `contree run` | `run` with `wait=true` |
| Start work and inspect it later | Use REST when the application must receive an operation ID immediately | Submit and keep the returned operation ID | Use `contree run -d`, then `contree op wait OPERATION_ID`; see the [operation reference](/sandboxes/cli/commands/operation) | `run` with `wait=false`, then `get_operation` or `wait_operations` |
| Save or discard filesystem changes | Set `disposable=False` to save or `True` to discard | Send `disposable: false` to save or `true` to discard; the request schema defaults to `false` | Runs save by default; add `-D` to discard | Set `disposable=false` to save; the tool defaults to `true` |
| Stream operation events and resume after disconnect | Use REST; SDK 0.3.6 has no event-stream method | Subscribe with SSE and resume with `Last-Event-Id` | CLI 0.9.4 has no event-stream command | The exposed tool set has no event-stream tool |
| Start and control another process inside an active operation | Use REST; SDK 0.3.6 has no additional-process API | Use the spawn, stdin, EOF, result, and signal endpoints | CLI 0.9.4 has no additional-process command | The exposed tool set has no additional-process, stdin, or signal tool |
| Inspect files in a stored image without guest compute | Use `ls`, `read`, and `download` | Use the image inspection endpoints | Use `ls`, `cat`, and `cp` | Use `list_files`, `read_file`, and `download` |

## Interface boundaries

* A Python SDK 0.3.6 `run()` call prepares work; awaiting the returned object submits it and waits for the final result.
* A CLI session tracks a selected image and local workflow history. It does not keep a VM alive.
* REST is the reference for operation status, SSE events, and additional subprocesses.
* MCP capabilities depend on the tools exposed by the deployed server. Check the connected server before building a workflow around a specific tool.

Choose persistence before submission on every interface. See [Images, checkpoints, and branches](/sandboxes/concepts/images-checkpoints-and-branches) for defaults and result-image outcomes.

## Continue

* [Set up access](/sandboxes/start/set-up-access)
* [Python quickstart](/sandboxes/start/python-quickstart)
* [CLI quickstart](/sandboxes/start/cli-quickstart)
* [Run commands and handle results](/sandboxes/guides/run-commands-and-results)
* [Stream output and events](/sandboxes/guides/stream-output-and-events)
* [Run subprocesses and send input](/sandboxes/guides/run-subprocesses-and-send-input)
* [Reference map](/sandboxes/reference/index)
