{
  "openapi": "3.1.0",
  "info": {
    "title": "Spaceyard API",
    "version": "1",
    "summary": "Cloud desktops for AI agents.",
    "description": "Spaceyard gives an AI agent a computer of its own: a Linux or Windows cloud desktop it starts with one API call, runs commands on and uses like a person through computer use (screenshots, clicks, typing). Sandboxes are billed by the minute, in euros.\n\nDocs: https://spaceyard.dev/docs (Markdown: https://spaceyard.dev/docs.md)."
  },
  "servers": [
    {
      "url": "https://api.spaceyard.dev/v1"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "externalDocs": {
    "url": "https://spaceyard.dev/docs"
  },
  "paths": {
    "/sandboxes/images": {
      "get": {
        "operationId": "listImages",
        "summary": "List images",
        "description": "The images you can start a sandbox from, with their size and prices. `allowed` says whether your account's level may start it, and `in_stock` whether there is room for one right now. `limits` is how many sandboxes you run and may run, and the largest size you may start; `lifecycle` holds the defaults a new sandbox gets.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#list-images"
        },
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Image"
                      }
                    },
                    "limits": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "used": {
                          "type": "integer"
                        },
                        "max": {
                          "type": "integer"
                        },
                        "cpu": {
                          "type": "integer"
                        },
                        "memory_mb": {
                          "type": "integer"
                        }
                      }
                    },
                    "currency": {
                      "type": "string"
                    },
                    "lifecycle": {
                      "type": "object",
                      "properties": {
                        "auto_stop_minutes": {
                          "type": "integer"
                        },
                        "auto_destroy_minutes": {
                          "type": "integer"
                        },
                        "min_auto_stop_minutes": {
                          "type": "integer"
                        },
                        "max_minutes": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": 1,
                      "name": "Ubuntu 24.04 desktop",
                      "slug": "ubuntu-desktop",
                      "os": "linux",
                      "desktop": true,
                      "vcpu": 2,
                      "memory_mb": 4096,
                      "disk_gb": 16,
                      "location": {
                        "id": 1,
                        "name": "Salt Lake City",
                        "short_code": "UT01",
                        "icon": null
                      },
                      "hourly_price": 0.0377,
                      "stopped_hourly_price": 0.0017,
                      "allowed": true,
                      "in_stock": true
                    }
                  ],
                  "limits": {
                    "used": 1,
                    "max": 2,
                    "cpu": 2,
                    "memory_mb": 4096
                  },
                  "currency": "EUR",
                  "lifecycle": {
                    "auto_stop_minutes": 15,
                    "auto_destroy_minutes": -1,
                    "min_auto_stop_minutes": 5,
                    "max_minutes": 43200
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sandboxes": {
      "post": {
        "operationId": "createSandbox",
        "summary": "Create a sandbox",
        "description": "Starts a new sandbox. Most often it comes back `creating`: ask for it with [Get a sandbox](https://spaceyard.dev/docs#get-sandbox) until it is `running`, usually a few seconds. One handed over from the warm pool is `running` at once.\n\nIt is refused with `422` when your credit is short, when your account is at its limits, or when the image is out of stock.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#create-sandbox"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "image_id": {
                    "type": "integer",
                    "description": "The image to start from, from [List images](https://spaceyard.dev/docs#list-images)."
                  },
                  "name": {
                    "type": "string",
                    "description": "A name of your own, up to 60 characters."
                  },
                  "auto_stop_minutes": {
                    "type": "integer",
                    "description": "Stop after this long without activity: 5 to 43,200, or `0` never. Defaults to the image list's `lifecycle`."
                  },
                  "auto_destroy_minutes": {
                    "type": "integer",
                    "description": "Destroy after being stopped this long: up to 43,200, `-1` never, `0` as soon as it stops."
                  },
                  "ephemeral": {
                    "type": "boolean",
                    "description": "Destroy it as soon as it stops. The same as `auto_destroy_minutes: 0`."
                  },
                  "env": {
                    "type": "object",
                    "description": "Environment variables, names to values. See [Environment variables](https://spaceyard.dev/docs#environment)."
                  }
                },
                "required": [
                  "image_id"
                ]
              },
              "example": {
                "image_id": 1,
                "name": "browser-agent",
                "auto_stop_minutes": 15,
                "env": {
                  "OPENAI_API_KEY": "sk-..."
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "201 Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Sandbox"
                    }
                  }
                },
                "example": {
                  "data": {
                    "uuid": "7f3c2a10-5b1e-4c2d-9a7e-2f1d8c4b6e90",
                    "name": "browser-agent",
                    "image": "Ubuntu 24.04 desktop",
                    "desktop": true,
                    "status": "creating",
                    "os": "linux",
                    "vcpu": 2,
                    "memory_mb": 4096,
                    "disk_gb": 16,
                    "private_ip": null,
                    "location": {
                      "id": 1,
                      "name": "Salt Lake City",
                      "short_code": "UT01",
                      "icon": null
                    },
                    "error": null,
                    "hourly_price": 0.0377,
                    "stopped_hourly_price": 0.0017,
                    "current_hourly_price": 0.0377,
                    "billed_total": 0,
                    "billed_until": null,
                    "from_pool": false,
                    "env": [
                      "OPENAI_API_KEY"
                    ],
                    "auto_stop_minutes": 15,
                    "auto_destroy_minutes": -1,
                    "ephemeral": false,
                    "created_at": "2026-11-25T18:00:12+00:00",
                    "stops_at": null,
                    "destroys_at": null
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listSandboxes",
        "summary": "List sandboxes",
        "description": "Your sandboxes that are not destroyed, newest first, with how many you run and may run.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#list-sandboxes"
        },
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Sandbox"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "ever_used": {
                          "type": "boolean"
                        },
                        "used": {
                          "type": "integer"
                        },
                        "max": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "uuid": "7f3c2a10-5b1e-4c2d-9a7e-2f1d8c4b6e90",
                      "name": "browser-agent",
                      "image": "Ubuntu 24.04 desktop",
                      "desktop": true,
                      "status": "running",
                      "os": "linux",
                      "vcpu": 2,
                      "memory_mb": 4096,
                      "disk_gb": 16,
                      "private_ip": "10.77.0.14",
                      "location": {
                        "id": 1,
                        "name": "Salt Lake City",
                        "short_code": "UT01",
                        "icon": null
                      },
                      "error": null,
                      "hourly_price": 0.0377,
                      "stopped_hourly_price": 0.0017,
                      "current_hourly_price": 0.0377,
                      "billed_total": 0.01257,
                      "billed_until": "2026-11-25T18:20:00+00:00",
                      "from_pool": true,
                      "env": [
                        "OPENAI_API_KEY"
                      ],
                      "auto_stop_minutes": 15,
                      "auto_destroy_minutes": -1,
                      "ephemeral": false,
                      "created_at": "2026-11-25T18:00:12+00:00",
                      "stops_at": "2026-11-25T18:35:00+00:00",
                      "destroys_at": null
                    }
                  ],
                  "meta": {
                    "ever_used": true,
                    "used": 1,
                    "max": 2
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sandboxes/{uuid}": {
      "get": {
        "operationId": "getSandbox",
        "summary": "Get a sandbox",
        "description": "One sandbox, with the user its desktop runs as: `root` on Linux, `Administrator` on Windows. Its `password` is set the first time the desktop is opened in the console, and empty until then. Use this to follow a sandbox through its [lifecycle](https://spaceyard.dev/docs#lifecycle).",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#get-sandbox"
        },
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The sandbox."
          }
        ],
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Sandbox"
                    }
                  }
                },
                "example": {
                  "data": {
                    "uuid": "7f3c2a10-5b1e-4c2d-9a7e-2f1d8c4b6e90",
                    "name": "browser-agent",
                    "image": "Ubuntu 24.04 desktop",
                    "desktop": true,
                    "status": "running",
                    "os": "linux",
                    "vcpu": 2,
                    "memory_mb": 4096,
                    "disk_gb": 16,
                    "private_ip": "10.77.0.14",
                    "location": {
                      "id": 1,
                      "name": "Salt Lake City",
                      "short_code": "UT01",
                      "icon": null
                    },
                    "error": null,
                    "hourly_price": 0.0377,
                    "stopped_hourly_price": 0.0017,
                    "current_hourly_price": 0.0377,
                    "billed_total": 0.01257,
                    "billed_until": "2026-11-25T18:20:00+00:00",
                    "from_pool": true,
                    "env": [
                      "OPENAI_API_KEY"
                    ],
                    "auto_stop_minutes": 15,
                    "auto_destroy_minutes": -1,
                    "ephemeral": false,
                    "created_at": "2026-11-25T18:00:12+00:00",
                    "stops_at": "2026-11-25T18:35:00+00:00",
                    "destroys_at": null,
                    "username": "root",
                    "password": null
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "destroySandbox",
        "summary": "Destroy a sandbox",
        "description": "Destroys a sandbox, disk and all, and bills its last minute. This cannot be undone.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#destroy-sandbox"
        },
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The sandbox."
          }
        ],
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Sandbox"
                    }
                  }
                },
                "example": {
                  "data": {
                    "uuid": "7f3c2a10-5b1e-4c2d-9a7e-2f1d8c4b6e90",
                    "name": "browser-agent",
                    "image": "Ubuntu 24.04 desktop",
                    "desktop": true,
                    "status": "deleting",
                    "os": "linux",
                    "vcpu": 2,
                    "memory_mb": 4096,
                    "disk_gb": 16,
                    "private_ip": "10.77.0.14",
                    "location": {
                      "id": 1,
                      "name": "Salt Lake City",
                      "short_code": "UT01",
                      "icon": null
                    },
                    "error": null,
                    "hourly_price": 0.0377,
                    "stopped_hourly_price": 0.0017,
                    "current_hourly_price": 0.0377,
                    "billed_total": 0.01257,
                    "billed_until": "2026-11-25T18:20:00+00:00",
                    "from_pool": true,
                    "env": [
                      "OPENAI_API_KEY"
                    ],
                    "auto_stop_minutes": 15,
                    "auto_destroy_minutes": -1,
                    "ephemeral": false,
                    "created_at": "2026-11-25T18:00:12+00:00",
                    "stops_at": null,
                    "destroys_at": null
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sandboxes/{uuid}/start": {
      "post": {
        "operationId": "startSandbox",
        "summary": "Start a sandbox",
        "description": "Starts a stopped sandbox, disk as it was. It goes through `starting` to `running`. Starting one that is not stopped changes nothing and answers with it as it is.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#start-sandbox"
        },
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The sandbox."
          }
        ],
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Sandbox"
                    }
                  }
                },
                "example": {
                  "data": {
                    "uuid": "7f3c2a10-5b1e-4c2d-9a7e-2f1d8c4b6e90",
                    "name": "browser-agent",
                    "image": "Ubuntu 24.04 desktop",
                    "desktop": true,
                    "status": "starting",
                    "os": "linux",
                    "vcpu": 2,
                    "memory_mb": 4096,
                    "disk_gb": 16,
                    "private_ip": "10.77.0.14",
                    "location": {
                      "id": 1,
                      "name": "Salt Lake City",
                      "short_code": "UT01",
                      "icon": null
                    },
                    "error": null,
                    "hourly_price": 0.0377,
                    "stopped_hourly_price": 0.0017,
                    "current_hourly_price": 0.0377,
                    "billed_total": 0.01257,
                    "billed_until": "2026-11-25T18:20:00+00:00",
                    "from_pool": true,
                    "env": [
                      "OPENAI_API_KEY"
                    ],
                    "auto_stop_minutes": 15,
                    "auto_destroy_minutes": -1,
                    "ephemeral": false,
                    "created_at": "2026-11-25T18:00:12+00:00",
                    "stops_at": null,
                    "destroys_at": null
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sandboxes/{uuid}/stop": {
      "post": {
        "operationId": "stopSandbox",
        "summary": "Stop a sandbox",
        "description": "Shuts a running sandbox down. It keeps its disk and pays only for that while stopped. An ephemeral sandbox is destroyed instead. While a sandbox is still `creating`, stopping it is refused: try again in a moment.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#stop-sandbox"
        },
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The sandbox."
          }
        ],
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Sandbox"
                    }
                  }
                },
                "example": {
                  "data": {
                    "uuid": "7f3c2a10-5b1e-4c2d-9a7e-2f1d8c4b6e90",
                    "name": "browser-agent",
                    "image": "Ubuntu 24.04 desktop",
                    "desktop": true,
                    "status": "stopping",
                    "os": "linux",
                    "vcpu": 2,
                    "memory_mb": 4096,
                    "disk_gb": 16,
                    "private_ip": "10.77.0.14",
                    "location": {
                      "id": 1,
                      "name": "Salt Lake City",
                      "short_code": "UT01",
                      "icon": null
                    },
                    "error": null,
                    "hourly_price": 0.0377,
                    "stopped_hourly_price": 0.0017,
                    "current_hourly_price": 0.0377,
                    "billed_total": 0.01257,
                    "billed_until": "2026-11-25T18:20:00+00:00",
                    "from_pool": true,
                    "env": [
                      "OPENAI_API_KEY"
                    ],
                    "auto_stop_minutes": 15,
                    "auto_destroy_minutes": -1,
                    "ephemeral": false,
                    "created_at": "2026-11-25T18:00:12+00:00",
                    "stops_at": null,
                    "destroys_at": null
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sandboxes/{uuid}/exec": {
      "post": {
        "operationId": "runCommand",
        "summary": "Run a command",
        "description": "Runs a command on a running sandbox and answers with its output. The request waits up to 60 seconds: a command still going after that keeps running, and comes back with `finished` false. Each of `stdout` and `stderr` is cut at 64 KB, and then `truncated` is true.\n\nA command that fails still answers `200`: look at `exit_code`. A sandbox that is not running answers `409`.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#run-command"
        },
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The sandbox."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "command": {
                    "type": "string",
                    "description": "Up to 8,000 characters. On Linux it runs with `/bin/sh -c` as root; on Windows in PowerShell."
                  }
                },
                "required": [
                  "command"
                ]
              },
              "example": {
                "command": "uname -a"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "finished": {
                          "type": "boolean",
                          "description": "False when it was still running after 60 seconds."
                        },
                        "exit_code": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "stdout": {
                          "type": "string"
                        },
                        "stderr": {
                          "type": "string"
                        },
                        "truncated": {
                          "type": "boolean",
                          "description": "Output was cut at 64 KB a stream."
                        },
                        "seconds": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "finished": true,
                    "exit_code": 0,
                    "stdout": "Linux sandbox 6.8.0-49-generic #49-Ubuntu SMP x86_64 GNU/Linux\n",
                    "stderr": "",
                    "truncated": false,
                    "seconds": 0.31
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sandboxes/{uuid}/computer": {
      "post": {
        "operationId": "computerUse",
        "summary": "Computer use",
        "description": "Uses the desktop of a running sandbox the way a person would: look at the screen, move the mouse, click, type, press keys and scroll. Coordinates are screen pixels from the top left; the Linux desktop is 1280 by 800. Each action has parameters of its own, in the same body, and the answer's `data` has `ok` and what the action reports.\n\nAn action the desktop could not carry out answers `422` with the reason, and what the desktop reported in `data`. Computer use needs a desktop image: a sandbox without one answers `422`.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#computer-use"
        },
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The sandbox."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "screenshot",
                      "size",
                      "cursor",
                      "move",
                      "click",
                      "mouse_down",
                      "mouse_up",
                      "drag",
                      "scroll",
                      "type",
                      "key",
                      "open",
                      "windows",
                      "focus",
                      "read_screen",
                      "wait"
                    ],
                    "description": "What to do. Its own parameters go in the same body."
                  },
                  "screenshot": {
                    "type": "boolean",
                    "description": "On an action that changes the screen, answer with a screenshot taken after it, as `screenshot`. Saves a second request."
                  }
                },
                "required": [
                  "action"
                ],
                "additionalProperties": true
              },
              "example": {
                "action": "click",
                "x": 640,
                "y": 400,
                "screenshot": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": true,
                      "description": "What the action reports: see the actions in the docs."
                    }
                  }
                },
                "example": {
                  "data": {
                    "ok": true,
                    "x": 640,
                    "y": 400,
                    "screenshot": {
                      "width": 1280,
                      "height": 800,
                      "format": "jpeg",
                      "image": "/9j/4AAQSkZJRgABAQAAAQABAAD..."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sandboxes/{uuid}/stream": {
      "post": {
        "operationId": "streamSandbox",
        "summary": "Stream the screen",
        "description": "Opens a live VNC stream of a running sandbox's screen and returns both:\n\n- `url` and `password`: a one-time VNC WebSocket (`binary` subprotocol, valid for `expires_in` seconds) for noVNC or native clients.\n- `embed_url`: a standalone viewer page you can place in an `<iframe>`. It stays valid and reconnectable until `embed_expires_at` (or until the sandbox stops), and never exposes the sandbox's OS login password.\n\nPass `view_only: true` to lock the embed viewer to watch-only mode. A sandbox that is not running answers `409`.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#stream-sandbox"
        },
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The sandbox."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "view_only": {
                    "type": "boolean",
                    "description": "Lock the embedded viewer to read-only mode (default `false`)."
                  },
                  "ttl": {
                    "type": "integer",
                    "description": "How long `embed_url` stays valid, in seconds: 60 to 43,200 (default `3600`)."
                  }
                },
                "required": []
              },
              "example": {
                "view_only": false,
                "ttl": 3600
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "protocol": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "password": {
                          "type": "string"
                        },
                        "expires_in": {
                          "type": "integer"
                        },
                        "embed_url": {
                          "type": "string"
                        },
                        "embed_expires_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "view_only": {
                          "type": "boolean"
                        },
                        "username": {
                          "type": "string"
                        },
                        "login_password": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "protocol": "vnc",
                    "url": "wss://console.spaceyard.dev/sandbox-console/aBcDeFgH1234567890aBcDeFgH1234567890aBcDeFgH1234",
                    "password": "PVEVNC:ticket...",
                    "expires_in": 30,
                    "embed_url": "https://console.spaceyard.dev/embed/sandboxes/7f3c2a10-5b1e-4c2d-9a7e-2f1d8c4b6e90?token=xYz0123456789xYz0123456789xYz0123456789xYz012345",
                    "embed_expires_at": "2026-11-25T19:01:03+00:00",
                    "view_only": false,
                    "username": "root",
                    "login_password": "..."
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sandboxes/{uuid}/logs": {
      "get": {
        "operationId": "logs",
        "summary": "Logs",
        "description": "What happened to a sandbox, newest first: who started and stopped it, every command and computer use action, and what it did by itself. `source` is `api`, `panel` for the console, or `system`. When `meta.more` is true there are older entries.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#logs"
        },
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The sandbox."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`all` (the default), `lifecycle`, `commands`, `computer` or `screen`."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "How many, 1 to 100 (50)."
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "For the next page: the smallest `id` you have so far."
          }
        ],
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "api",
                              "panel",
                              "system"
                            ]
                          },
                          "action": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "ok",
                              "failed"
                            ]
                          },
                          "message": {
                            "type": "string"
                          },
                          "detail": {
                            "type": [
                              "object",
                              "null"
                            ]
                          },
                          "duration_ms": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "more": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": 1042,
                      "at": "2026-11-25T18:01:03.120+00:00",
                      "source": "api",
                      "action": "command",
                      "status": "ok",
                      "message": "uname -a",
                      "detail": {
                        "command": "uname -a",
                        "exit_code": 0
                      },
                      "duration_ms": 312
                    }
                  ],
                  "meta": {
                    "more": false
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sandboxes/snapshots": {
      "get": {
        "operationId": "listSnapshots",
        "summary": "List snapshots",
        "description": "Official snapshots (`data`) and your own custom snapshots (`custom`), grouped by slug across regions, together with all sandbox-capable `locations` and your warm pool limits.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#list-snapshots"
        },
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "custom": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "short_code": {
                            "type": "string"
                          },
                          "icon": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "warm_pool_limits": {
                      "type": "object",
                      "properties": {
                        "used": {
                          "type": "integer"
                        },
                        "max": {
                          "type": "integer"
                        }
                      }
                    },
                    "snapshot_gb_hour_price": {
                      "type": "number"
                    },
                    "open": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "data": [],
                  "custom": [
                    {
                      "slug": "snap-a1b2c3d4",
                      "name": "python-chrome",
                      "custom": true,
                      "os": "linux",
                      "desktop": true,
                      "vcpu": 2,
                      "memory_mb": 4096,
                      "disk_gb": 16,
                      "hourly_price": 0.0377,
                      "stopped_hourly_price": 0.0017,
                      "allowed": true,
                      "created_at": "2026-11-25T18:10:00+00:00",
                      "regions": [
                        {
                          "image_id": 42,
                          "location": {
                            "id": 1,
                            "name": "Salt Lake City",
                            "short_code": "UT01",
                            "icon": null
                          },
                          "status": "ready",
                          "build_step": null,
                          "build_error": null,
                          "used_bytes": 2684354560,
                          "used_gb": 2.5,
                          "storage_hourly_price": 0.0005,
                          "billed_total": 0.001,
                          "in_stock": true,
                          "warm_pool": null,
                          "created_at": "2026-11-25T18:10:00+00:00"
                        }
                      ]
                    }
                  ],
                  "locations": [
                    {
                      "id": 1,
                      "name": "Salt Lake City",
                      "short_code": "UT01",
                      "icon": null
                    }
                  ],
                  "warm_pool_limits": {
                    "used": 0,
                    "max": 2
                  },
                  "sizing": {
                    "max_vcpu": 4,
                    "max_memory_mb": 8192,
                    "max_disk_gb": 200,
                    "memory_step_mb": 512,
                    "min": {
                      "linux": {
                        "server": {
                          "vcpu": 1,
                          "memory_mb": 1024
                        },
                        "desktop": {
                          "vcpu": 1,
                          "memory_mb": 2048
                        }
                      },
                      "windows": {
                        "server": {
                          "vcpu": 2,
                          "memory_mb": 2048
                        },
                        "desktop": {
                          "vcpu": 2,
                          "memory_mb": 4096
                        }
                      }
                    }
                  },
                  "rates": {
                    "cpu_hour": 0.0108,
                    "windows_cpu_hour": 0.0144,
                    "ram_gb_hour": 0.0036,
                    "disk_gb_hour": 0.000108,
                    "currency": "EUR"
                  },
                  "snapshot_gb_hour_price": 0.0002,
                  "open": true
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createSnapshot",
        "summary": "Create a custom snapshot",
        "description": "Builds a new custom snapshot directly from an existing ready snapshot (official or custom) with chosen `vcpu`, `memory_mb`, and `disk_gb`. Official snapshots keep their fixed sizes; custom sizing applies only to custom snapshots you create. Disk can grow from the source size (up to 200 GB) and cannot shrink.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#create-snapshot"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_image_id": {
                    "type": "integer",
                    "description": "A ready official or custom snapshot `image_id` from [List snapshots](https://spaceyard.dev/docs#list-snapshots)."
                  },
                  "name": {
                    "type": "string",
                    "description": "A name for the snapshot, up to 80 characters."
                  },
                  "vcpu": {
                    "type": "integer",
                    "description": "vCPU count, within your account level limit. Defaults to the source snapshot."
                  },
                  "memory_mb": {
                    "type": "integer",
                    "description": "Memory in MB (512 MB increments), within your account level limit. Defaults to the source snapshot."
                  },
                  "disk_gb": {
                    "type": "integer",
                    "description": "Disk in GB, at least the source disk and up to 200 GB. Defaults to the source snapshot."
                  }
                },
                "required": [
                  "source_image_id",
                  "name"
                ]
              },
              "example": {
                "source_image_id": 1,
                "name": "ubuntu-4cpu",
                "vcpu": 4,
                "memory_mb": 8192,
                "disk_gb": 50
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "201 Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "image_id": {
                          "type": "integer"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "os": {
                          "type": "string",
                          "enum": [
                            "linux",
                            "windows"
                          ]
                        },
                        "desktop": {
                          "type": "boolean"
                        },
                        "vcpu": {
                          "type": "integer"
                        },
                        "memory_mb": {
                          "type": "integer"
                        },
                        "disk_gb": {
                          "type": "integer"
                        },
                        "status": {
                          "type": "string"
                        },
                        "location": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer"
                            },
                            "name": {
                              "type": "string"
                            },
                            "short_code": {
                              "type": "string"
                            },
                            "icon": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "image_id": 44,
                    "slug": "snap-e5f6g7h8",
                    "name": "ubuntu-4cpu",
                    "os": "linux",
                    "desktop": true,
                    "vcpu": 4,
                    "memory_mb": 8192,
                    "disk_gb": 50,
                    "hourly_price": 0.0774,
                    "stopped_hourly_price": 0.0054,
                    "status": "building",
                    "build_step": "queued",
                    "build_error": null,
                    "used_bytes": 0,
                    "used_gb": 0,
                    "storage_hourly_price": 0,
                    "billed_total": 0,
                    "location": {
                      "id": 1,
                      "name": "Salt Lake City",
                      "short_code": "UT01",
                      "icon": null
                    },
                    "created_at": "2026-11-25T18:10:00+00:00"
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sandboxes/{uuid}/snapshots": {
      "post": {
        "operationId": "captureSnapshot",
        "summary": "Capture a snapshot",
        "description": "Captures a reusable custom snapshot (disk and saved memory state) from a running or stopped sandbox. Pass optional `vcpu`, `memory_mb`, and `disk_gb` to size the new custom snapshot differently from the source sandbox (disk can grow up to 200 GB, never shrink). Starts with `status: \"building\"`; poll [List snapshots](https://spaceyard.dev/docs#list-snapshots) until it is `ready`, then pass its `image_id` to [Create a sandbox](https://spaceyard.dev/docs#create-sandbox).",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#capture-snapshot"
        },
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The sandbox."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "A name for the snapshot, up to 80 characters."
                  },
                  "vcpu": {
                    "type": "integer",
                    "description": "Optional vCPU count, within your account level limit. Defaults to the sandbox."
                  },
                  "memory_mb": {
                    "type": "integer",
                    "description": "Optional memory in MB (512 MB increments), within your account level limit. Defaults to the sandbox."
                  },
                  "disk_gb": {
                    "type": "integer",
                    "description": "Optional disk in GB, at least the sandbox disk and up to 200 GB. Defaults to the sandbox."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "python-chrome",
                "vcpu": 4,
                "memory_mb": 8192,
                "disk_gb": 32
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "201 Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "image_id": {
                          "type": "integer"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "os": {
                          "type": "string",
                          "enum": [
                            "linux",
                            "windows"
                          ]
                        },
                        "desktop": {
                          "type": "boolean"
                        },
                        "vcpu": {
                          "type": "integer"
                        },
                        "memory_mb": {
                          "type": "integer"
                        },
                        "disk_gb": {
                          "type": "integer"
                        },
                        "status": {
                          "type": "string"
                        },
                        "location": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer"
                            },
                            "name": {
                              "type": "string"
                            },
                            "short_code": {
                              "type": "string"
                            },
                            "icon": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "image_id": 42,
                    "slug": "snap-a1b2c3d4",
                    "name": "python-chrome",
                    "os": "linux",
                    "desktop": true,
                    "vcpu": 4,
                    "memory_mb": 8192,
                    "disk_gb": 32,
                    "hourly_price": 0.0755,
                    "stopped_hourly_price": 0.0035,
                    "status": "building",
                    "build_step": "queued",
                    "build_error": null,
                    "used_bytes": 0,
                    "used_gb": 0,
                    "storage_hourly_price": 0,
                    "billed_total": 0,
                    "location": {
                      "id": 1,
                      "name": "Salt Lake City",
                      "short_code": "UT01",
                      "icon": null
                    },
                    "created_at": "2026-11-25T18:10:00+00:00"
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sandboxes/snapshots/{id}": {
      "patch": {
        "operationId": "editSnapshot",
        "summary": "Edit a custom snapshot",
        "description": "Renames a custom snapshot or changes its `vcpu`, `memory_mb`, and `disk_gb`. Official snapshots cannot be edited. Renaming applies immediately across all regions; changing size drains any attached warm pools, rebuilds each ready region copy at the new specs (existing sandboxes keep running unaffected), and automatically reloads warm pools once the rebuild completes.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#edit-snapshot"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Resource id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New snapshot name, up to 80 characters."
                  },
                  "vcpu": {
                    "type": "integer",
                    "description": "New vCPU count, within your account level limit."
                  },
                  "memory_mb": {
                    "type": "integer",
                    "description": "New memory in MB (512 MB increments), within your account level limit."
                  },
                  "disk_gb": {
                    "type": "integer",
                    "description": "New disk in GB, at least the current disk and up to 200 GB."
                  }
                },
                "required": []
              },
              "example": {
                "name": "python-chrome-4cpu",
                "vcpu": 4,
                "memory_mb": 8192,
                "disk_gb": 40
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "image_id": {
                          "type": "integer"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "os": {
                          "type": "string",
                          "enum": [
                            "linux",
                            "windows"
                          ]
                        },
                        "desktop": {
                          "type": "boolean"
                        },
                        "vcpu": {
                          "type": "integer"
                        },
                        "memory_mb": {
                          "type": "integer"
                        },
                        "disk_gb": {
                          "type": "integer"
                        },
                        "status": {
                          "type": "string"
                        },
                        "location": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer"
                            },
                            "name": {
                              "type": "string"
                            },
                            "short_code": {
                              "type": "string"
                            },
                            "icon": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "image_id": 42,
                    "slug": "snap-a1b2c3d4",
                    "name": "python-chrome-4cpu",
                    "os": "linux",
                    "desktop": true,
                    "vcpu": 2,
                    "memory_mb": 4096,
                    "disk_gb": 16,
                    "hourly_price": 0.0377,
                    "stopped_hourly_price": 0.0017,
                    "status": "building",
                    "build_step": "queued",
                    "build_error": null,
                    "used_bytes": 2684354560,
                    "used_gb": 2.5,
                    "storage_hourly_price": 0.0005,
                    "billed_total": 0.001,
                    "location": {
                      "id": 1,
                      "name": "Salt Lake City",
                      "short_code": "UT01",
                      "icon": null
                    },
                    "created_at": "2026-11-25T18:10:00+00:00"
                  },
                  "rebuilding": 1,
                  "warm_pools_reloading": 1
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteSnapshot",
        "summary": "Delete a snapshot",
        "description": "Deletes a custom snapshot copy from its region, settles its final storage billing and tears down the template. Drain its warm pool and destroy any live sandboxes using it first.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#delete-snapshot"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Resource id."
          }
        ],
        "responses": {
          "204": {
            "description": "204 No Content",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sandboxes/snapshots/{id}/deploy": {
      "post": {
        "operationId": "deploySnapshot",
        "summary": "Deploy a snapshot",
        "description": "Replicates a ready custom snapshot to a sandbox node in another region so you can boot sandboxes and warm pools from it there.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#deploy-snapshot"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Resource id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "location_id": {
                    "type": "integer",
                    "description": "Target location id from [List snapshots](https://spaceyard.dev/docs#list-snapshots)."
                  }
                },
                "required": [
                  "location_id"
                ]
              },
              "example": {
                "location_id": 2
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "201 Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "image_id": {
                          "type": "integer"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "os": {
                          "type": "string",
                          "enum": [
                            "linux",
                            "windows"
                          ]
                        },
                        "desktop": {
                          "type": "boolean"
                        },
                        "vcpu": {
                          "type": "integer"
                        },
                        "memory_mb": {
                          "type": "integer"
                        },
                        "disk_gb": {
                          "type": "integer"
                        },
                        "status": {
                          "type": "string"
                        },
                        "location": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer"
                            },
                            "name": {
                              "type": "string"
                            },
                            "short_code": {
                              "type": "string"
                            },
                            "icon": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "image_id": 43,
                    "slug": "snap-a1b2c3d4",
                    "name": "python-chrome",
                    "os": "linux",
                    "desktop": true,
                    "vcpu": 2,
                    "memory_mb": 4096,
                    "disk_gb": 16,
                    "status": "building",
                    "build_step": "queued",
                    "build_error": null,
                    "used_bytes": 0,
                    "used_gb": 0,
                    "storage_hourly_price": 0,
                    "billed_total": 0,
                    "location": {
                      "id": 2,
                      "name": "Amsterdam",
                      "short_code": "NL01",
                      "icon": null
                    },
                    "created_at": "2026-11-25T18:15:00+00:00"
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sandboxes/warm-pools": {
      "get": {
        "operationId": "listWarmPools",
        "summary": "List warm pools",
        "description": "Your active custom warm pools, with ready and warming counts, hourly price and your account's warm pool quota.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#list-warm-pools"
        },
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "limits": {
                      "type": "object",
                      "properties": {
                        "used": {
                          "type": "integer"
                        },
                        "max": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": 7,
                      "image_id": 42,
                      "image_name": "python-chrome",
                      "image_slug": "snap-a1b2c3d4",
                      "custom": true,
                      "os": "linux",
                      "desktop": true,
                      "vcpu": 2,
                      "memory_mb": 4096,
                      "disk_gb": 16,
                      "location": {
                        "id": 1,
                        "name": "Salt Lake City",
                        "short_code": "UT01",
                        "icon": null
                      },
                      "size": 2,
                      "ready": 2,
                      "warming": 0,
                      "paused_reason": null,
                      "hourly_price_per_vm": 0.0377,
                      "hourly_price_total": 0.0754
                    }
                  ],
                  "limits": {
                    "used": 2,
                    "max": 5
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "upsertWarmPool",
        "summary": "Set a warm pool",
        "description": "Creates or resizes a warm pool of pre-booted sandboxes for one of your custom snapshots. Set `size` to `0` to drain it. Official images use the shared platform pool.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#upsert-warm-pool"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "image_id": {
                    "type": "integer",
                    "description": "A ready custom snapshot `image_id` from [List snapshots](https://spaceyard.dev/docs#list-snapshots)."
                  },
                  "size": {
                    "type": "integer",
                    "description": "Number of pre-warmed sandboxes to keep ready, 0 to 100 (capped by account limits)."
                  }
                },
                "required": [
                  "image_id",
                  "size"
                ]
              },
              "example": {
                "image_id": 42,
                "size": 2
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "limits": {
                      "type": "object",
                      "properties": {
                        "used": {
                          "type": "integer"
                        },
                        "max": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": 7,
                    "image_id": 42,
                    "image_name": "python-chrome",
                    "image_slug": "snap-a1b2c3d4",
                    "custom": true,
                    "os": "linux",
                    "desktop": true,
                    "vcpu": 2,
                    "memory_mb": 4096,
                    "disk_gb": 16,
                    "location": {
                      "id": 1,
                      "name": "Salt Lake City",
                      "short_code": "UT01",
                      "icon": null
                    },
                    "size": 2,
                    "ready": 0,
                    "warming": 2,
                    "paused_reason": null,
                    "hourly_price_per_vm": 0.0377,
                    "hourly_price_total": 0.0754
                  },
                  "limits": {
                    "used": 2,
                    "max": 5
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sandboxes/warm-pools/{id}": {
      "delete": {
        "operationId": "deleteWarmPool",
        "summary": "Delete a warm pool",
        "description": "Drains a warm pool back to `0` and returns your updated warm pool quota.",
        "externalDocs": {
          "url": "https://spaceyard.dev/docs#delete-warm-pool"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Resource id."
          }
        ],
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "limits": {
                      "type": "object",
                      "properties": {
                        "used": {
                          "type": "integer"
                        },
                        "max": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "limits": {
                    "used": 0,
                    "max": 5
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error, in the error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Your API key, from https://console.spaceyard.dev/api-key."
      }
    },
    "schemas": {
      "Sandbox": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Its id, in every path."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name you gave it."
          },
          "image": {
            "type": "string",
            "description": "The image it was started from."
          },
          "desktop": {
            "type": "boolean",
            "description": "It has a desktop, so computer use works."
          },
          "status": {
            "type": "string",
            "enum": [
              "creating",
              "starting",
              "running",
              "stopping",
              "stopped",
              "deleting",
              "deleted",
              "failed"
            ],
            "description": "Where it is in its lifecycle."
          },
          "os": {
            "type": "string",
            "enum": [
              "linux",
              "windows"
            ]
          },
          "vcpu": {
            "type": "integer",
            "description": "Its vCPUs."
          },
          "memory_mb": {
            "type": "integer",
            "description": "Its memory, in MB."
          },
          "disk_gb": {
            "type": "integer",
            "description": "Its disk, in GB."
          },
          "private_ip": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its address on the private network."
          },
          "location": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "short_code": {
                "type": "string"
              },
              "icon": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it failed, when it did."
          },
          "hourly_price": {
            "type": "number",
            "description": "Euros an hour while it runs."
          },
          "stopped_hourly_price": {
            "type": "number",
            "description": "Euros an hour while it is stopped: its disk."
          },
          "current_hourly_price": {
            "type": "number",
            "description": "What it pays now: the stopped price while stopped."
          },
          "billed_total": {
            "type": "number",
            "description": "Euros charged for it so far."
          },
          "billed_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "How far it has been billed."
          },
          "from_pool": {
            "type": "boolean",
            "description": "Handed over already running from the warm pool."
          },
          "env": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The names of its environment variables, never the values."
          },
          "auto_stop_minutes": {
            "type": "integer",
            "description": "Stops after this long without activity; 0 never."
          },
          "auto_destroy_minutes": {
            "type": "integer",
            "description": "Destroyed after being stopped this long; -1 never, 0 at once."
          },
          "ephemeral": {
            "type": "boolean",
            "description": "It is destroyed as soon as it stops."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was created."
          },
          "stops_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "While running: when it stops by itself if left idle."
          },
          "destroys_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "While stopped: when it is destroyed by itself."
          }
        }
      },
      "Image": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "os": {
            "type": "string",
            "enum": [
              "linux",
              "windows"
            ]
          },
          "desktop": {
            "type": "boolean"
          },
          "vcpu": {
            "type": "integer"
          },
          "memory_mb": {
            "type": "integer"
          },
          "disk_gb": {
            "type": "integer"
          },
          "location": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "short_code": {
                "type": "string"
              },
              "icon": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "hourly_price": {
            "type": "number",
            "description": "Euros an hour while running."
          },
          "stopped_hourly_price": {
            "type": "number",
            "description": "Euros an hour while stopped."
          },
          "allowed": {
            "type": "boolean",
            "description": "Your account's level may start it."
          },
          "in_stock": {
            "type": "boolean",
            "description": "There is room for one right now."
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "examples": [
                  "UNAUTHENTICATED",
                  "INVALID_TOKEN",
                  "ACCOUNT_BANNED",
                  "NOT_FOUND",
                  "CONFLICT",
                  "VALIDATION_ERROR",
                  "UNPROCESSABLE",
                  "RATE_LIMITED",
                  "UNAVAILABLE",
                  "INTERNAL_ERROR"
                ]
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object",
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "description": "On a validation error: what is wrong with each field."
              }
            }
          },
          "data": {
            "type": "object",
            "description": "When a computer use action failed: what the desktop reported."
          }
        }
      }
    }
  }
}