> ## Documentation Index
> Fetch the complete documentation index at: https://vastai-80aa3a82-docs-disable-ssh-password-login.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# VastAI.defrag_machines

Defragment machines.

<Note>This is a **host** method, used for managing machines you are renting out on Vast.ai.</Note>

## Signature

```python theme={null}
VastAI.defrag_machines(ids: List[int]) -> dict
```

## Parameters

<ParamField path="ids" type="List[int]" required>
  Machine IDs to defragment.
</ParamField>

## Returns

`dict`

## Example

```python theme={null}
from vastai import VastAI

client = VastAI(api_key="YOUR_API_KEY")
result = client.defrag_machines(ids=[12345])
print(result)
```
