# Create pools

URL: https://docs.hanzo.ai/docs/openapi/compute/createnodepool

> Adds a node pool to one of the caller org's clusters and answers 201 with the created pool.

`POST /v1/compute/clusters/{clusterId}/pools`

> [Compute →](https://docs.hanzo.ai/docs/openapi/compute) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                              |
| ------------- | ------------------------------------------------------------ |
| **Address**   | `https://api.hanzo.ai/v1/compute/clusters/{clusterId}/pools` |
| **Method**    | `POST`                                                       |
| **Operation** | `createNodePool`                                             |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`                       |

Adds a node pool to one of the caller org's clusters and answers 201
with the created pool. Only the CreateNodePoolSpec fields are forwarded;
owner/provider/clusterId ride in the query exactly as Visor expects them.

## Request

9 fields, body `application/json` (required).

| Field       | In   | Type            | Required | Description                                                                                                      |
| ----------- | ---- | --------------- | -------- | ---------------------------------------------------------------------------------------------------------------- |
| `clusterId` | path | string          | yes      | ClusterID is the cluster to add the pool to, from the URL path.                                                  |
| `autoScale` | body | boolean         | —        | AutoScale turns the provider's cluster autoscaler on for this pool.                                              |
| `clusterId` | body | string          | —        | ClusterID is the cluster to add the pool to, from the URL path.                                                  |
| `count`     | body | integer (int64) | —        | Count is how many nodes the pool starts with.                                                                    |
| `maxNodes`  | body | integer (int64) | —        | MaxNodes is the ceiling the autoscaler may not grow the pool past, and so the bound on what this pool can spend. |
| `minNodes`  | body | integer (int64) | —        | MinNodes is the floor the autoscaler may not shrink the pool below.                                              |
| `name`      | body | string          | —        | Name is the pool's name.                                                                                         |
| `provider`  | body | string          | —        | Provider is the cloud the cluster lives on (e.g. "digitalocean").                                                |
| `size`      | body | string          | —        | Size is the provider size slug for each node (e.g. "s-4vcpu-8gb").                                               |

## Response

| Status    | Body                 | Meaning |
| --------- | -------------------- | ------- |
| `200`     | compute.nodePoolView | ok      |
| `default` | problem-details      | refused |

`200` body — 7 fields.

| Field       | In   | Type            | Always | Description                                                                                                                                        |
| ----------- | ---- | --------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `autoScale` | body | boolean         | —      | AutoScale reports whether the provider's cluster autoscaler owns this pool's size, moving Count between MinNodes and MaxNodes as workloads demand. |
| `count`     | body | integer (int64) | —      | Count is how many nodes the pool has right now.                                                                                                    |
| `maxNodes`  | body | integer (int64) | —      | MaxNodes is the ceiling the autoscaler will not grow the pool past, and so the bound on what this pool can cost.                                   |
| `minNodes`  | body | integer (int64) | —      | MinNodes is the floor the autoscaler will not shrink the pool below.                                                                               |
| `name`      | body | string          | —      | Name is the pool's name as the provider knows it.                                                                                                  |
| `poolId`    | body | string          | —      | PoolID is the provider's id for the pool — the value the scale and delete routes address it by.                                                    |
| `size`      | body | string          | —      | Size is the provider size slug every node in the pool runs at ("s-4vcpu-8gb", "gpu-h100x8-640gb").                                                 |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo compute clusters pools create <clusterId>
```

**SDK**

**.ts**

```ts
import { Configuration, ComputeApi } from 'hanzoai';

const api = new ComputeApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.createNodePool({ clusterId: 'clusterId', autoScale: false, clusterId: "<clusterId>" });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ComputeApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ComputeApi(client).create_node_pool(cluster_id='clusterId', auto_scale=False, cluster_id="<clusterId>")
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.ComputeAPI.CreateNodePool(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, compute_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = compute_api::create_node_pool(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ComputeApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new ComputeApi(client).createNodePool();
```

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/compute/clusters/<clusterId>/pools \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "autoScale": false,
       "clusterId": "<clusterId>"
     }'
```

**MCP**

Tool `compute`, op `createNodePool` — POST the JSON-RPC envelope to `https://api.hanzo.ai/v1/mcp`.

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "compute",
         "arguments": {
           "op": "createNodePool",
           "input": {
             "clusterId": "<clusterId>",
             "autoScale": false
           }
         }
       }
     }'
```

---

[Compute API](https://docs.hanzo.ai/docs/openapi/compute) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
