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

# Unikraft Cloud

> The millisecond compute layer, with VM-grade isolation and scale to zero

[Unikraft Cloud](https://unikraft.com) is the millisecond compute layer for sandboxes and AI agents, with VM-grade isolation and scale to zero. Connect your Unikraft Cloud account with a custom pool.

## Why Unikraft Cloud

* **Scale to zero in milliseconds.** Agents often wait on a model, a tool, or a person. With [sleep](/machines/providers/overview#sleep-when-idle) on, Unikraft Cloud snapshots an idle machine, scales it to zero in under 10 ms, and resumes it in milliseconds with its memory, files, and running processes intact.
* **The security of VMs, the tools you love.** Each machine is its own hardware-isolated microVM, and you define it with a Dockerfile, just like a container.
* **Built for scale.** Unikraft Cloud packs up to 100,000 instances onto a single server and handles millions of microVMs, so it keeps up with fleets of agents.
* **Your cloud, your way.** Unikraft's enterprise plan deploys Unikraft Cloud on-premises, in your own cloud account, or on dedicated hosts. Point a pool at your deployment with `api_base_url`.

## Set up a Unikraft pool

<Steps>
  <Step title="Create an API token">
    Sign up for [Unikraft Cloud](https://console.unikraft.cloud) and create an API token in the console. The token has full access to your account. Store it as an org-owned [secret](/organization/secrets) in Omnara.
  </Step>

  <Step title="Build an image">
    Start from the Omnara repository's [example image](https://github.com/omnara-ai/omnara/tree/main/examples/unikraft-machine), which packages the daemon. Building it needs Go, Docker, and the [Unikraft CLI](https://unikraft.com/docs/cli), signed in with `unikraft login`.

    Add your agents' tools to the example's `Dockerfile` rather than a startup script, since startup scripts have limited space on Unikraft. Then build and push the image from the repository root with your image name and an `omnarad` release version:

    ```bash theme={null}
    ./examples/unikraft-machine/build.sh acme/omnara-machine:v1 0.1.0
    ```
  </Step>

  <Step title="Create the pool">
    On the **Machines** page, click **New pool** and choose **Unikraft**. Enter the credential, image, metro, CPU and memory, and capacity limits. Files that agents write are kept in memory, so size memory to fit their repositories and dependencies.

    To use the API instead, call [Create a pool](/machines/pools#create-a-pool) with the fields under [API fields](#api-fields). The dashboard can't turn on sleep yet, so set `sleep_after_ms` through the API.
  </Step>
</Steps>

## API fields

When you create a pool through the API, send these fields in the [Create a pool](/machines/pools#create-a-pool) request. `provider_config` applies to the whole pool, and `default_machine_provider_options` sets the options for each new machine, which project grants and agent configs can override. For example:

```jsonc theme={null}
{
  "name": "unikraft-pool",
  "provider": "unikraft",
  "provider_auth_secret_id": "sec_hcyd5n6a2bfgik7mv4qtrwz3je",
  "default_machine_provider_options": {
    "image": "acme/omnara-machine:v1",
    "metro": "fra",
    "sleep_after_ms": 300000 // optional
  },
  "default_machine_cpu": 1,
  "default_machine_memory_mb": 2048,
  "max_machine_cpu": 2,
  "max_machine_memory_mb": 4096,
  "max_total_cpu": 4,
  "max_total_memory_mb": 8192,
  "max_total_machines": 4
}
```

* `image` is an image in Unikraft's registry.
* `metro` is `fra`, `sfo`, `dal`, `was`, or `sin`.
* `sleep_after_ms` turns on [sleep](/machines/providers/overview#sleep-when-idle). Omit it to keep machines awake.
* Optional: a short `startup_script` in `default_machine_provider_options` runs on each new machine before the daemon starts. In `provider_config`, `api_base_url` points the pool at a custom Unikraft Cloud API (an HTTPS URL without a path, used for every metro), and `allowed_images` and `allowed_metros` are [allowlists](/machines/providers/overview#allowlists).


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