> ## Documentation Index
> Fetch the complete documentation index at: https://vastai-80aa3a82-host-2752-sla-api-documentation.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# vastai schedule maint

> Host command

Schedule an upcoming maintenance window

<Note>This is a **host** command, used for managing machines you are renting out on Vast.ai. First time? Install the CLI via [CLI hello world](/cli/hello-world), then confirm with `vastai --help`.</Note>

## Usage

```bash theme={null}
vastai schedule maint id [--sdate START_DATE --duration DURATION --maintenance_category MAINTENANCE_CATEGORY]
```

<Note>`schedule maintenance` is an alias for `schedule maint` if your CLI build supports both spellings. Prefer `maint`. Requires `machine_write` on scoped API keys — see [Permissions](/api-reference/permissions).</Note>

## Arguments

<ParamField path="id" type="integer" required>
  ID of the machine to schedule maintenance for.
</ParamField>

## Options

<ParamField path="--sdate" type="number">
  Maintenance start time as Unix epoch seconds (UTC). Example: `1677562671`. The API receives an ISO 8601 UTC datetime after conversion.
</ParamField>

<ParamField path="--duration" type="number">
  Maintenance duration in hours. Prefer whole hours for REST compatibility (OpenAPI `duration` is an integer). The CLI may accept fractional values (for example `0.5`).
</ParamField>

<ParamField path="--maintenance_category" type="string" default="not provided">
  (optional) can be one of \[power, internet, disk, gpu, software, other]
</ParamField>

<Note>
  Optional REST body field `maintenance_reason` (short description for notifications) is available on [Schedule Maintenance](/api-reference/machines/schedule-maint). The published CLI does not yet expose a `--maintenance_reason` flag.
</Note>

## Description

The lowest-risk path is to wait until all active contracts have expired or the machine is vacant, then take the machine offline.

The same `schedule maint` command is used for both **planned** and **emergency** downtime — advance notice and duration determine SLA credit eligibility, not the category value.

### Planned SLA maintenance

If SLA is enabled and you need planned downtime during an active rental, schedule at least 24 hours in advance. See [SLA Offers → Scheduled maintenance](/host/sla-offers#scheduled-maintenance).

```bash theme={null}
# Replace MACHINE_ID; --sdate must be a future UTC epoch (≥24h ahead for planned credit review)
# Linux: date -u -d '2026-08-01 02:00:00' +%s
# macOS: date -u -j -f '%Y-%m-%d %H:%M:%S' '2026-08-01 02:00:00' +%s
vastai schedule maint MACHINE_ID \
  --sdate "$(date -u -d '2026-08-01 02:00:00' +%s)" \
  --duration 2 \
  --maintenance_category software
```

### Emergency or unplanned maintenance

If the machine must go offline without adequate notice, still run `schedule maint` to notify renters — but expect full SLA settlement exposure when SLA is enabled. Use the current UTC epoch for `--sdate` and an integer `--duration` (hours):

```bash theme={null}
vastai schedule maint MACHINE_ID --sdate "$(date -u +%s)" --duration 1 --maintenance_category power
```

To cancel a scheduled window, use [`vastai cancel maint`](/host/cli/cancel-maint). To reschedule, cancel first, then schedule a new window (≥24 hours ahead for planned SLA credit review). Across many machines, schedule sequentially and back off on HTTP 429.

## Examples

```bash theme={null}
vastai schedule maint <ID> --sdate <unix_epoch_seconds> --duration <hours> --maintenance_category software
```

## Global Options

The following options are available for all commands:

| Option          | Description                                           |
| --------------- | ----------------------------------------------------- |
| `--url URL`     | Server REST API URL                                   |
| `--retry N`     | Retry limit                                           |
| `--raw`         | Output machine-readable JSON                          |
| `--explain`     | Verbose explanation of API calls                      |
| `--api-key KEY` | API key (defaults to `~/.config/vastai/vast_api_key`) |
