# Get clusters

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

> Returns one cluster's detail: node pools + worker nodes.

`GET /v1/compute/k8s/clusters/{id}`

> [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/k8s/clusters/{id}` |
| **Method**    | `GET`                                               |
| **Operation** | `getKubernetesCluster`                              |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`              |

Returns one cluster's detail: node pools + worker nodes. Visor scopes
the lookup to the org (a foreign or missing id resolves to not-found), so a tenant
can never read another tenant's cluster by guessing an id.

## Request

1 field.

| Field | In   | Type   | Required | Description                           |
| ----- | ---- | ------ | -------- | ------------------------------------- |
| `id`  | path | string | yes      | ID is the provider's DOKS cluster id. |

## Response

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

`200` body — 48 fields.

| Field                         | In   | Type                    | Always | Description                                                                                                                                                                                                             |
| ----------------------------- | ---- | ----------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `amdGpu`                      | body | integer (int64)         | —      |                                                                                                                                                                                                                         |
| `createdAt`                   | body | string                  | —      |                                                                                                                                                                                                                         |
| `doClusterId`                 | body | string                  | —      |                                                                                                                                                                                                                         |
| `doksClusterId`               | body | string                  | —      |                                                                                                                                                                                                                         |
| `kind`                        | body | string                  | —      |                                                                                                                                                                                                                         |
| `name`                        | body | string                  | —      |                                                                                                                                                                                                                         |
| `nodeCount`                   | body | integer (int64)         | —      |                                                                                                                                                                                                                         |
| `nodePools`                   | body | compute.nodePoolView\[] | —      |                                                                                                                                                                                                                         |
| `nodePools[].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.                                                                      |
| `nodePools[].count`           | body | integer (int64)         | —      | Count is how many nodes the pool has right now.                                                                                                                                                                         |
| `nodePools[].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.                                                                                                        |
| `nodePools[].minNodes`        | body | integer (int64)         | —      | MinNodes is the floor the autoscaler will not shrink the pool below.                                                                                                                                                    |
| `nodePools[].name`            | body | string                  | —      | Name is the pool's name as the provider knows it.                                                                                                                                                                       |
| `nodePools[].poolId`          | body | string                  | —      | PoolID is the provider's id for the pool — the value the scale and delete routes address it by.                                                                                                                         |
| `nodePools[].size`            | body | string                  | —      | Size is the provider size slug every node in the pool runs at ("s-4vcpu-8gb", "gpu-h100x8-640gb").                                                                                                                      |
| `nodeSize`                    | body | string                  | —      |                                                                                                                                                                                                                         |
| `nodes`                       | body | compute.machineView\[]  | —      | Nodes is every worker node in the cluster, each in the same shape the machines surface uses — a node IS a machine, addressable by its own id.                                                                           |
| `nodes[].agent`               | body | string                  | —      | Agent is the cloud Agent this machine runs, lifted out of the binding so a list reads without following one.                                                                                                            |
| `nodes[].binding`             | body | compute.agentBinding    | —      |                                                                                                                                                                                                                         |
| `nodes[].binding.agentName`   | body | string                  | —      | AgentName is the cloud Agent (/v1/agent) this machine runs — the agent a message to the bot is actually run against.                                                                                                    |
| `nodes[].binding.botVersion`  | body | string                  | —      | BotVersion pins the @hanzo/bot runtime version the machine runs.                                                                                                                                                        |
| `nodes[].binding.createdTime` | body | string                  | —      | CreatedTime is when the binding was first made.                                                                                                                                                                         |
| `nodes[].binding.machineId`   | body | string                  | —      | MachineId is the bound machine as vm addresses it, owner-qualified ("\<org>/\<machine>").                                                                                                                               |
| `nodes[].binding.message`     | body | string                  | —      | Message is vm's human-readable detail on Status ("machine provisioning; @hanzo/bot runtime not yet confirmed") — the reason behind the state, not a second state.                                                       |
| `nodes[].binding.name`        | body | string                  | —      | Name is the binding's own key, which is the machine's id: a machine hosts at most one agent, so the binding is named for it.                                                                                            |
| `nodes[].binding.org`         | body | string                  | —      | Org is the Hanzo tenant the binding belongs to.                                                                                                                                                                         |
| `nodes[].binding.owner`       | body | string                  | —      | Owner is the tenant vm filed the binding under, resolved from the ?owner it was called with — which is the caller's validated org and never a body field.                                                               |
| `nodes[].binding.provider`    | body | string                  | —      | Provider is the cloud the bound machine runs on, carried here so a bindings list says where each bot lives without a second read per machine.                                                                           |
| `nodes[].binding.publicIp`    | body | string                  | —      | PublicIp is the bound machine's public address as vm recorded it on the binding.                                                                                                                                        |
| `nodes[].binding.status`      | body | string                  | —      | Status is the binding's lifecycle in VM's OWN words — "Pending" while the machine provisions and the runtime is unconfirmed, "running" once vm has confirmed it.                                                        |
| `nodes[].binding.updatedTime` | body | string                  | —      | UpdatedTime is when vm last reconciled it — the age of Status.                                                                                                                                                          |
| `nodes[].createdTime`         | body | string                  | —      | CreatedTime is when the machine came into being: the provider's own creation timestamp for a Visor machine, passed through in whatever form it states it, and for a BYO machine the RFC 3339 moment it first dialed in. |
| `nodes[].gpu`                 | body | string                  | —      | GPU names the accelerators this machine holds ("H100", or "2× NVIDIA GB10" for a BYO machine reporting a matched pair).                                                                                                 |
| `nodes[].id`                  | body | string                  | —      | ID addresses this machine on the /v1/compute/machines/:id routes: the org-scoped NAME Visor keys a machine by, falling back to the provider id for a machine that has no name.                                          |
| `nodes[].image`               | body | string                  | —      | Image is the OS image the machine booted from, as the provider names it.                                                                                                                                                |
| `nodes[].mem`                 | body | string                  | —      | Mem is system RAM rendered for a human ("8 GB"), not a number to compute with.                                                                                                                                          |
| `nodes[].name`                | body | string                  | —      | Name is the label to show a human — Visor's displayName, or the machine name when it carries none.                                                                                                                      |
| `nodes[].os`                  | body | string                  | —      | Os is the operating system on the machine — Visor's record for a provisioned one, the host's own report (linux, darwin, windows) for a BYO one.                                                                         |
| `nodes[].privateIp`           | body | string                  | —      | PrivateIp is the address on the provider's own network, reachable from the org's other machines in the same region.                                                                                                     |
| `nodes[].provider`            | body | string                  | —      | Provider is the cloud that runs the machine ("digitalocean"), or "byo" for one the operator dialed in with `hanzo link`.                                                                                                |
| `nodes[].publicIp`            | body | string                  | —      | PublicIp is the internet-facing address the provider assigned.                                                                                                                                                          |
| `nodes[].region`              | body | string                  | —      | Region is the provider region slug ("sfo3"), or the zone when the provider reports only that.                                                                                                                           |
| `nodes[].status`              | body | string                  | —      | Status is the lifecycle state in the PROVIDER's own words ("active", "running", "off"), passed through rather than mapped onto a vocabulary of ours.                                                                    |
| `nodes[].type`                | body | string                  | —      | Type is the provider SIZE SLUG the machine runs at ("s-2vcpu-4gb", "gpu-h100x8-640gb") — the value a launch asks for, and what Vcpu/Mem/GPU are read out of when the provider states them no other way.                 |
| `nodes[].vcpu`                | body | integer (int64)         | —      | Vcpu is logical cores — the provider's own cpuSize when that is a clean integer, else the count read out of the size slug (4 from "s-4vcpu-8gb").                                                                       |
| `nvidiaGpu`                   | body | integer (int64)         | —      |                                                                                                                                                                                                                         |
| `region`                      | body | string                  | —      |                                                                                                                                                                                                                         |
| `status`                      | body | string                  | —      |                                                                                                                                                                                                                         |

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

## Examples

**CLI**

```bash
hanzo compute k8s clusters get <id>
```

**SDK**

**.ts**

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

const api = new ComputeApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getKubernetesCluster({ id: 'id' });
```

**.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).get_kubernetes_cluster(id='id')
```

**.go**

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

resp, _, err := client.ComputeAPI.GetKubernetesCluster(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::get_kubernetes_cluster(&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).getKubernetesCluster();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/compute/k8s/clusters/<id> \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

Tool `compute`, op `getKubernetesCluster` — 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": "getKubernetesCluster",
           "input": {
             "id": "<id>"
           }
         }
       }
     }'
```

---

[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)
