> For the complete documentation index, see [llms.txt](https://docs.computesdk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.computesdk.com/providers/miosa.md).

# MIOSA

MIOSA provides hardware-isolated Firecracker microVM sandboxes with fast snapshot-backed startup, native filesystem APIs, preview URLs, and checkpoints.

[MIOSA](https://miosa.ai) provides hardware-isolated Firecracker microVM sandboxes through the ComputeSDK interface.

The default sandbox uses 2 vCPU, 4 GiB of memory, and 10 GiB of copy-on-write disk.

## Installation & Setup

```bash
npm install computesdk @computesdk/miosa
```

Create an API key in MIOSA and add it to your environment:

```bash
MIOSA_API_KEY=msk_your_api_key
```

## Usage

```typescript
import { miosa } from '@computesdk/miosa';

const compute = miosa({
  apiKey: process.env.MIOSA_API_KEY,
});

const sandbox = await compute.sandbox.create();
const result = await sandbox.runCommand('node -v');
console.log(result.stdout);
await sandbox.destroy();
```

### Configuration Options

```typescript
interface MiosaConfig {
  /** MIOSA API key. Falls back to `MIOSA_API_KEY`. */
  apiKey?: string;
  /** API base URL for MIOSA or a white-label control plane. */
  baseUrl?: string;
  /** Default sandbox lifetime in milliseconds. */
  timeout?: number;
}
```

### Supported Operations

| Method       | Supported | Notes                                                                                                                        |
| ------------ | --------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `create`     | Yes       | Creates a command-ready Firecracker microVM and accepts templates, snapshots, environment variables, metadata, and timeouts. |
| `getById`    | Yes       | Returns `null` when the sandbox does not exist.                                                                              |
| `list`       | Yes       | Lists the caller's sandboxes.                                                                                                |
| `destroy`    | Yes       | Idempotent when the sandbox is already absent.                                                                               |
| `runCommand` | Yes       | Supports working directory, environment, timeout, and background execution.                                                  |
| `getInfo`    | Yes       | Maps MIOSA lifecycle state to the ComputeSDK status model.                                                                   |
| `getUrl`     | Yes       | Creates a tenant-aware public preview URL for a port.                                                                        |
| `filesystem` | Yes       | Native read, write, directory, list, existence, and remove operations.                                                       |
| `snapshot`   | Partial   | Creates and lists Firecracker checkpoints. ComputeSDK does not currently pass the sandbox scope required for deletion.       |

### Runtime Model

MIOSA serves the default create path from certified snapshot-derived warm slots, immutable shared base images, per-sandbox copy-on-write disks, and preallocated network capacity.

When warm capacity is unavailable, the snapshot restore path supports `userfaultfd` lazy paging and fails closed if the requested runtime contract cannot be proven.

The same API supports custom domains, persistent graduation, and off-host recovery outside the portable ComputeSDK surface.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.computesdk.com/providers/miosa.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
