# Delete clusters — DELETE /v1/compute/k8s/clusters/{id}

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

> Destroys a DOKS cluster by id and answers 204.

`DELETE /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**    | `DELETE`                                            |
| **Operation** | `deleteKubernetesCluster`                           |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`              |

Destroys a DOKS cluster by id and answers 204. ADMIN-GATED, like
create. Visor scopes the delete to the org (refuses a foreign id), so this can
only ever remove the caller org's own cluster.

## Request

1 field.

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

## Response

| Status    | Body            | Meaning    |
| --------- | --------------- | ---------- |
| `204`     | —               | no content |
| `default` | problem-details | refused    |

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

## Examples

**CLI**

```bash
hanzo compute k8s clusters rm <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.deleteKubernetesCluster({ 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).delete_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.DeleteKubernetesCluster(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::delete_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).deleteKubernetesCluster();
```

**HTTP**

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

**MCP**

Tool `compute`, op `deleteKubernetesCluster` — 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": "deleteKubernetesCluster",
           "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)
