---
title: Automate the nodes you host
slug: automate-the-nodes-you-host
createdAt: 2026-11-25T00:13:10.519Z
---

If you host nodes on OctaSpace, you can manage them from scripts: watch their status, change prices on a schedule and take them off rent for maintenance.

## List your nodes

```bash
octa hosting list
octa hosting list -o json
```

```go
nodes, err := client.Hosting.Nodes(ctx)
for _, n := range nodes {
	fmt.Println(n.Number, n.Status, n.Prices.Base, n.UptimePercent)
}
```

```javascript
const nodes = await client.hosting.nodes()
```

The list contains your **online** nodes with their status, the services they are offered for, prices, hardware, location and uptime. A node that is offline is not listed, and `GET /hosting/nodes/{number}` returns `404` for it.

| Status         | Meaning                        |
| -------------- | ------------------------------ |
| `idle`         | Online and available for rent  |
| `rented`       | Running a renter's session     |
| `verification` | Being verified by the platform |
| `benchmark`    | Running a benchmark            |

A node you took off rent has `maintenance: true`, whatever its status. A node that runs only VPN sessions stays `idle`.

:::BlockQuote
**Tip: detect a node that went down.** Compare the list with the node numbers you expect; a missing number means the node is offline. OctaSpace also notifies you in Telegram when a node stays offline (set it up under **Account → Notifications**).
:::

## Change prices

Only the prices you send change.

```bash
octa hosting prices 7KQ4-M2XD-4 --base 0.25 --storage 0.0001 --min-rent 15
```

```bash
curl -s -X PATCH https://api.octa.space/hosting/nodes/7KQ4-M2XD-4/prices \
  -H "Authorization: Bearer $OCTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"base": 250000, "min_rent_minutes": 15}'
```

```go
err := client.Hosting.SetPrices(ctx, "7KQ4-M2XD-4", octaspace.NodePrices{
	Base: octaspace.Price(250_000),
})
```

```javascript
await client.hosting.setPrices('7KQ4-M2XD-4', { base: usdToMicroUsd(0.25) })
```

| Price                   | Field              | Range                             |
| ----------------------- | ------------------ | --------------------------------- |
| Per hour                | `base`             | $0.0001 to $1000                  |
| Per GB of disk per hour | `storage`          | $0 to $1000                       |
| Per GB of traffic       | `traffic`          | $0.0001 to $1000                  |
| Minimum rent            | `min_rent_minutes` | 0 to 60 minutes, `0` turns it off |

The CLI takes dollars; the API and SDKs take integer micro-USD. New prices show in the listings within a few seconds and apply to new sessions only: running sessions keep the prices they started with.

### Example: price by time of day

Raise prices during peak hours with cron:

```bash
# crontab -e
0 9  * * *  octa hosting prices 7KQ4-M2XD-4 --base 0.35
0 22 * * *  octa hosting prices 7KQ4-M2XD-4 --base 0.20
```

### Example: follow the market

Use the GPU market statistics (public, no key needed) to keep your price near the median:

```javascript
const market = await client.stats.gpuCurrent({ verified: 'yes' })
const rtx = market.gpus.find((g) => g.model === 'NVIDIA GeForce RTX 4090')
const median = rtx?.rented_price?.p50 // micro-USD per GPU-hour
if (median) {
  await client.hosting.setPrices('7KQ4-M2XD-4', { base: Math.round(median * 0.95) })
}
```

Prices in the statistics are per GPU-hour; multiply by the number of GPUs in your node.

## Maintenance

Take a node off rent before you work on it, and offer it again afterwards. Sessions already running go on, and their renters are notified.

```bash
octa hosting maintenance 7KQ4-M2XD-4 on
# ... update drivers, reboot ...
octa hosting maintenance 7KQ4-M2XD-4 off
```

```bash
curl -s -X PUT    https://api.octa.space/hosting/nodes/7KQ4-M2XD-4/maintenance -H "Authorization: Bearer $OCTA_API_KEY"
curl -s -X DELETE https://api.octa.space/hosting/nodes/7KQ4-M2XD-4/maintenance -H "Authorization: Bearer $OCTA_API_KEY"
```

```go
err := client.Hosting.SetMaintenance(ctx, "7KQ4-M2XD-4", true)  // on
err = client.Hosting.SetMaintenance(ctx, "7KQ4-M2XD-4", false)  // off
```

Maintenance works for an offline node too, and repeating a call changes nothing.

### Example: wait until the node is free

```bash
NODE=7KQ4-M2XD-4
octa hosting maintenance "$NODE" on
while [ "$(octa hosting show "$NODE" -o json | jq -r .status)" = "rented" ]; do
  sleep 60
done
echo "No sessions left, safe to reboot"
```

