---
title: "cleanup machine"
method: PUT
path: "/api/v0/machines/{machine_id}/cleanup/"
tags: ["Machines"]
---

# cleanup machine

`PUT /api/v0/machines/{machine_id}/cleanup/`

This endpoint removes expired contracts on a specified machine, freeing up space.

CLI Usage: `vastai cleanup machine <machine_id>`

## Path parameters

- `machine_id` integer, required

## Request body

- object — An empty JSON object is expected.

## Response `200`

Success response

- object
  - `success` boolean
  - `ctime` number, float
  - `machine_id` integer
  - `user_id` integer
  - `num_deleted` integer
  - `msg` string

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `429` — Too Many Requests

---

[API](https://skmtc.net/vast/apis/vast-ai-api.md) · [All operations](https://skmtc.net/vast/apis/vast-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vast/vast-ai-api/revisions/4ed14f79f796/schema)
