---
title: "Create a cache disk."
method: POST
path: "/v1/cache-disks"
tags: ["cache-disks"]
---

# Create a cache disk.

`POST /v1/cache-disks`

## Request

- Base URL: `https://api.smolmachines.com`
- URL: `https://api.smolmachines.com/v1/cache-disks`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/smolmachines/apis/smolfleet-api/docs/v1/cache-disks/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a cache disk whose version 0 is an empty filesystem of `sizeGb`. Machines start from a version with `cacheDisk` on create, each through its own copy-on-write layer. Requires the `machine:create` scope.

## Request body

- CreateCacheDiskRequest: Create a cache disk.
  - `mountPath` string, nullable: Absolute guest path machines mount it at unless they say otherwise. Default `/cache`.
  - `name` string, required: Unique within your account: 1-63 chars of `[a-z0-9]([a-z0-9._-]*[a-z0-9])?`.
  - `sizeGb` integer, nullable: Size of the cache filesystem in GiB (1-500). Default 20.

## Response `201`

Cache disk created

- CacheDiskInfo: A cache disk: a disk image many machines start from, each through its own copy-on-write layer, published in immutable versions.
  - `createdAt` string, required
  - `id` string, required
  - `latestVersion` integer, required
  - `mountPath` string, required
  - `name` string, required
  - `sizeGb` integer, required
  - `versions` CacheDiskVersionInfo[], required: Newest first.
    - `createdAt` string, required
    - `sha256` string, required: SHA-256 (hex) of the version's disk image.
    - `sizeBytes` integer, required
    - `sourceMachineId` string, nullable: The machine whose cache this version was published from; `null` for v0.
    - `version` integer, required: 0 is the empty filesystem a cache disk starts as; each publish adds one.

## Other responses

- `400`: Invalid name, size or mount path
- `401`: Missing or invalid API key
- `403`: Key lacks the required scope
- `409`: A cache disk with that name exists
- `422`: Cache disks are not available on this platform
- `429`: Rate limited; retry after the Retry-After header
- `500`: Internal error

## Changes

- **2026-10-16** `bc31fc04a568`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/smolmachines/apis/smolfleet-api/changes/v1/cache-disks/post.md)

---

[API](https://skmtc.dev/smolmachines/apis/smolfleet-api.md) - [All operations](https://skmtc.dev/smolmachines/apis/smolfleet-api/llms.txt) - [OpenAPI document](https://skmtc.dev/smolmachines/apis/smolfleet-api/revisions/bc31fc04a568?raw)
