---
title: Start many sessions at once
slug: start-many-sessions-at-once
createdAt: 2026-11-25T00:13:10.640Z
---

A batch start launches several sessions in one request. Each item succeeds or fails on its own: one node being taken does not stop the others.

Batches work for compute and render. Send an **array** to the same endpoint (`POST /services/compute` or `POST /services/render`).

## Same session on several machines

**CLI:** repeat `--node`.

```bash
octa compute start --node 7KQ4-M2XD-4 --node M95S-WZG8-7 --node 3HW9-P6TR-8 \
  --image ubuntu:24.04 --ssh --wait
```

## Different requests

Each item has the usual start fields plus an `id` you choose (a string or a number); it comes back in the result so you can match them.

```json
[
  { "id": "train", "node_number": "7KQ4-M2XD-4", "image": "pytorch/pytorch", "disk_size": 100, "ssh": true },
  { "id": "web",   "node_number": "M95S-WZG8-7", "image": "nginx", "http_ports": [80] }
]
```

**CLI**

```bash
octa compute start --from-file batch.json --wait
```

**curl**

```bash
curl -s https://api.octa.space/services/compute \
  -H "Authorization: Bearer $OCTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d @batch.json
```

**Go**

```go
results, err := client.Compute.StartBatch(ctx, []octaspace.ComputeBatchItem{
	{ID: "train", ComputeStartParams: octaspace.ComputeStartParams{NodeNumber: "7KQ4-M2XD-4", Image: "pytorch/pytorch", DiskSize: 100}},
	{ID: "web", ComputeStartParams: octaspace.ComputeStartParams{NodeNumber: "M95S-WZG8-7", Image: "nginx", HTTPPorts: []int{80}}},
})
for _, r := range results {
	if r.OK() {
		fmt.Println(r.ID, "started", r.UUID)
	} else {
		fmt.Println(r.ID, "failed:", r.Reason)
	}
}
```

**JavaScript**

```javascript
const results = await client.compute.startBatch([
  { id: 'train', node_number: '7KQ4-M2XD-4', image: 'pytorch/pytorch', disk_size: 100 },
  { id: 'web', node_number: 'M95S-WZG8-7', image: 'nginx', http_ports: [80] },
])
for (const r of results) {
  if (r.status === 0) console.log(r.id, 'started', r.uuid)
  else console.log(r.id, 'failed:', r.reason)
}
```

In the SDKs `id` is optional: an item without one gets its position in the array. In the raw API it is required.

## Result

`200` with one result per item, in the order of the request:

```json
[
  { "id": "train", "status": 0, "uuid": "96e33710-ec12-11ed-8588-fa163e49e8aa" },
  { "id": "web",   "status": 1, "reason": "Node not available" }
]
```

| `status` | Meaning                            |
| -------- | ---------------------------------- |
| `0`      | Started; `uuid` is the new session |
| `1`      | Failed; `reason` says why          |

The request itself succeeds even if some items fail; always check each result. The CLI exits with an error when any item failed.

## Limits

- Each item counts toward the limit of **10 starts per minute** per account. For more, split the work into batches and wait between them (`Retry-After` on `429`).
- Your balance must cover the minimum for each session; items beyond what it covers fail with `Insufficient balance`.
- A batch is never retried automatically. If the request itself fails (network error, `5xx`), check `GET /sessions` before you send it again.

## Retry the failed items

A common pattern: pick spare machines from the listing and retry only the failed items on them.

```javascript
const failed = results.filter((r) => r.status === 1).map((r) => r.id)
// choose other node_numbers for these ids from client.compute.list(), then startBatch again
```

