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

# Switch from Daytona

> Point the Daytona SDK at Styne by changing its API URL and key; your code stays as it is.

**You need** a Styne API key; create one on the dashboard ([API keys](https://docs.styne.ai/authentication.md)).

The unmodified Daytona SDK, Python `daytona` and TypeScript `@daytonaio/sdk` 0.231.0, passes create, exec, code run, files, list, stop and start, and delete against `https://api.styne.ai`.

**1. Switch**

```text theme={"theme":"css-variables"}
DAYTONA_API_URL=https://api.styne.ai/daytona/api
DAYTONA_API_KEY=<your Styne API key>
```

Export both in the process environment; Daytona ignores URL variables set in a `.env` file. Daytona's own default is `https://app.daytona.io/api` (source: Daytona docs, read 2026-11-08).

**2. Check**

Create a sandbox with the Daytona SDK, read it back and delete it.

```python theme={"theme":"css-variables"}
from daytona import Daytona

daytona = Daytona()
sandbox = daytona.create()
try:
    print("created", bool(sandbox.id))
finally:
    daytona.delete(sandbox)
print("deleted")
```

```text theme={"theme":"css-variables"}
created True
deleted
```

Then run a command and move a file, the calls that go through the sandbox's own agent. On the public API the host is `api.styne.ai`.

```text theme={"theme":"css-variables"}
from daytona import Daytona

daytona = Daytona()
sandbox = daytona.create()
try:
    print(sandbox.process.exec("echo ok").result.strip())
    sandbox.fs.upload_file(b"file\n", "/root/check.txt")
    print(sandbox.fs.download_file("/root/check.txt").decode().strip())
finally:
    daytona.delete(sandbox)
```

Expected output: `ok`, then `file`.

**3. Adapt what differs**

| In Daytona | On Styne |
| - | - |
| A Daytona snapshot or Dockerfile image | A plain Python, Node.js, Debian or Ubuntu image, and Daytona's default snapshot, get `base`; any other image answers `422` with its name. Install your toolchain in `base` and save a Styne [snapshot](https://docs.styne.ai/guide-templates.md#make-your-own-start-state) |
| `stop` and `start` | Map to pause and resume; the state is kept ([pause tiers](https://docs.styne.ai/pause-tiers.md)) |
| Volumes | Served: `daytona.volume.create`, `get` (with `create=True`), `list` and `delete`, and `volumes=[VolumeMount(volume_id=..., mount_path=...)]` on create mount them ([volumes](https://docs.styne.ai/volumes.md)). A volume is a disk of up to 100 GiB in one region; a sandbox with volumes ends, rather than pauses, at its auto-stop interval, and its volumes keep their files |
| `autoStopInterval` (minutes) | Becomes the sandbox lifetime (900 seconds when absent; 0 or more than a day is capped at 86,400 seconds), then the sandbox stops (pauses). Auto-archive is not used |
| Resources (`cpu`, `memory`, `disk`) | A sandbox takes the size of its template (4 vCPU, 8 GiB memory, 51 GiB disk on `base`); asking for more answers `400` |

**4. Routes served**

These Daytona routes are served; the list is generated from the code that registers them. Paths are relative to `https://api.styne.ai/daytona/api` (the `api_url` the SDK takes). Paths under `/toolbox/{id}` are served there and also under `/sandbox/{id}/toolbox`, `/toolbox/{id}/toolbox` and the `toolboxProxyUrl` of the sandbox (`https://api.styne.ai/daytona/toolbox`).

| Method | Path |
| - | - |
| `GET` | `/health` |
| `GET/POST` | `/sandbox` |
| `GET` | `/sandbox/paginated` |
| `GET/DELETE` | `/sandbox/{id}` |
| `POST` | `/sandbox/{id}/stop` |
| `POST` | `/sandbox/{id}/start` |
| `POST` | `/sandbox/{id}/pause` |
| `POST` | `/sandbox/{id}/fork` |
| `GET` | `/sandbox/{id}/ports/{port}/preview-url` |
| `GET` | `/sandbox/{id}/toolbox-proxy-url` |
| `POST` | `/sandbox/{id}/snapshot` |
| `PUT` | `/sandbox/{id}/labels` |
| `POST` | `/sandbox/{id}/network-settings` |
| `POST` | `/sandbox/{id}/autostop/{interval}` |
| `POST` | `/sandbox/{id}/autopause/{interval}` |
| `POST` | `/sandbox/{id}/archive` |
| `GET` | `/snapshots` |
| `GET/DELETE` | `/snapshots/{name}` |
| `GET/POST` | `/volumes` |
| `GET` | `/volumes/by-name/{name}` |
| `GET/DELETE` | `/volumes/{id}` |
| `POST` | `/toolbox/{id}/process/execute` |
| `POST` | `/toolbox/{id}/process/code-run` |
| `GET/DELETE` | `/toolbox/{id}/files` |
| `GET` | `/toolbox/{id}/files/info` |
| `POST` | `/toolbox/{id}/files/folder` |
| `POST` | `/toolbox/{id}/files/move` |
| `GET` | `/toolbox/{id}/files/download` |
| `POST` | `/toolbox/{id}/files/upload` |
| `POST` | `/toolbox/{id}/files/upload-v2` |
| `POST` | `/toolbox/{id}/files/bulk-upload` |
| `POST` | `/toolbox/{id}/files/bulk-download` |
| `GET` | `/toolbox/{id}/info/work-dir` |
| `GET` | `/toolbox/{id}/info/user-home-dir` |
| `GET` | `/toolbox/{id}/work-dir` |
| `GET` | `/toolbox/{id}/user-home-dir` |
| `GET` | `/toolbox/{id}/files/find` |
| `GET` | `/toolbox/{id}/files/search` |
| `POST` | `/toolbox/{id}/files/replace` |
| `GET/POST` | `/toolbox/{id}/process/session` |
| `GET/DELETE` | `/toolbox/{id}/process/session/{session}` |
| `POST` | `/toolbox/{id}/process/session/{session}/exec` |
| `GET` | `/toolbox/{id}/process/session/{session}/command/{command}` |
| `GET` | `/toolbox/{id}/process/session/{session}/command/{command}/logs` |
| `POST` | `/toolbox/{id}/process/session/{session}/command/{command}/input` |
| `GET/POST` | `/toolbox/{id}/process/pty` |
| `GET` | `/toolbox/{id}/process/pty/create-connect` |
| `GET/DELETE` | `/toolbox/{id}/process/pty/{session}` |
| `GET` | `/toolbox/{id}/process/pty/{session}/connect` |
| `POST` | `/toolbox/{id}/process/pty/{session}/resize` |

`archive` pauses the sandbox, which keeps its files and memory; labels set with `set_labels` replace the labels of creation.

**5. Cut over**

Keep the two variables behind a switch in your config, send a small share of work to Styne, compare results, and move the rest. [Errors](https://docs.styne.ai/errors.md) lists every code the API can answer; [limits](https://docs.styne.ai/limits.md) every limit. Check your usage under [Plans and billing](https://docs.styne.ai/billing.md#read-your-usage).

## What maps

* `daytona.create()` creates a sandbox; `snapshot` names a Styne template (`base`), and the Styne `class` field is passed through as an extra create field.
* Process and file calls run through the sandbox's own agent.
* Sessions work as in Daytona: `create_session`, `execute_session_command` (synchronous, or detached with `run_async`), `get_session_command`, `get_session_command_logs`, `send_session_command_input` and `delete_session`. A session keeps its working directory and exported variables from one command to the next.
* PTY sessions work as in Daytona: `create_pty_session` and `connect_pty_session` open a WebSocket to a login shell with a terminal, `resize_pty_session` changes its size, `list_pty_sessions`, `get_pty_session_info` and `kill_pty_session` manage them. The shell outlives the connection until you kill it, a sandbox holds up to 16, and its output stays available to a connection made later.
* The toolbox also answers Daytona's earlier REST paths, `/sandbox/{id}/toolbox/...` and `/toolbox/{id}/toolbox/...` under `DAYTONA_API_URL`, for clients that call them directly.
* Preview URLs follow `https://<port>-<sandbox id>.styne.ai`.

## What is different

* A create without a `snapshot` gets `base`, the general Linux image (Debian 12; Python 3 as `python` and `python3` with `pip install`, Node 22, git, curl, wget and `sudo` installed, and a `daytona` account). The `WORKDIR` of a create's Dockerfile is made in the sandbox, and a command whose `cwd` does not exist answers `400` naming the directory.
* Beyond the Daytona SDK you also get [fork](https://docs.styne.ai/fork.md), [snapshots](https://docs.styne.ai/snapshots.md), signed file URLs ([files](https://docs.styne.ai/files.md)) and public ports ([ports](https://docs.styne.ai/ports.md)) over plain HTTP; see the [HTTP quickstart](https://docs.styne.ai/quickstart.md).


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