# Kubernetes clusters

## Get Kubernetes Clusters

> Get all Kubernetes clusters for a project

```json
{"openapi":"3.1.0","info":{"title":"Mithril","version":"1.0.0"},"servers":[{"url":"https://api.mithril.ai"}],"security":[{"MithrilAPIKey":[]}],"components":{"securitySchemes":{"MithrilAPIKey":{"type":"http","scheme":"bearer","bearerFormat":"fkey_<key>"}},"schemas":{"KubernetesClusterModel":{"properties":{"fid":{"type":"string","title":"Fid"},"project":{"type":"string","title":"Project"},"name":{"type":"string","title":"Name"},"region":{"type":"string","title":"Region"},"created_at":{"type":"string","format":"datetime","title":"Created At"},"kube_host":{"type":"string","nullable":true},"ssh_keys":{"items":{"type":"string"},"type":"array","title":"Ssh Keys"},"instances":{"items":{"type":"string"},"type":"array","title":"Instances"},"join_command":{"type":"string","nullable":true},"status":{"type":"string","enum":["Pending","Available","Terminated"],"title":"Status"},"deleted_at":{"type":"string","format":"datetime","nullable":true},"k8s_version":{"type":"string","title":"K8S Version"},"user_fid":{"type":"string","nullable":true}},"type":"object","required":["fid","project","name","region","created_at","ssh_keys","instances","status","k8s_version"],"title":"KubernetesClusterModel"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"oneOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/kubernetes/clusters":{"get":{"tags":["kubernetes clusters"],"summary":"Get Kubernetes Clusters","description":"Get all Kubernetes clusters for a project","operationId":"get_kubernetes_clusters_v2_kubernetes_clusters_get","parameters":[{"name":"project","in":"query","required":true,"schema":{"type":"string","title":"Project"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/KubernetesClusterModel"},"title":"Response Get Kubernetes Clusters V2 Kubernetes Clusters Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Create Kubernetes Cluster

> Create a new Kubernetes cluster

```json
{"openapi":"3.1.0","info":{"title":"Mithril","version":"1.0.0"},"servers":[{"url":"https://api.mithril.ai"}],"security":[{"MithrilAPIKey":[]}],"components":{"securitySchemes":{"MithrilAPIKey":{"type":"http","scheme":"bearer","bearerFormat":"fkey_<key>"}},"schemas":{"CreateKubernetesClusterRequest":{"properties":{"name":{"type":"string","title":"Name"},"project":{"type":"string","title":"Project"},"region":{"type":"string","title":"Region"},"ssh_keys":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Ssh Keys"},"instance_type":{"type":"string","title":"Instance Type"},"k8s_version":{"type":"string","enum":["1.34","1.29"],"title":"K8S Version","default":"1.34"},"image_version":{"type":"string","nullable":true}},"type":"object","required":["name","project","region","ssh_keys","instance_type"],"title":"CreateKubernetesClusterRequest"},"KubernetesClusterModel":{"properties":{"fid":{"type":"string","title":"Fid"},"project":{"type":"string","title":"Project"},"name":{"type":"string","title":"Name"},"region":{"type":"string","title":"Region"},"created_at":{"type":"string","format":"datetime","title":"Created At"},"kube_host":{"type":"string","nullable":true},"ssh_keys":{"items":{"type":"string"},"type":"array","title":"Ssh Keys"},"instances":{"items":{"type":"string"},"type":"array","title":"Instances"},"join_command":{"type":"string","nullable":true},"status":{"type":"string","enum":["Pending","Available","Terminated"],"title":"Status"},"deleted_at":{"type":"string","format":"datetime","nullable":true},"k8s_version":{"type":"string","title":"K8S Version"},"user_fid":{"type":"string","nullable":true}},"type":"object","required":["fid","project","name","region","created_at","ssh_keys","instances","status","k8s_version"],"title":"KubernetesClusterModel"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"oneOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/kubernetes/clusters":{"post":{"tags":["kubernetes clusters"],"summary":"Create Kubernetes Cluster","description":"Create a new Kubernetes cluster","operationId":"create_kubernetes_cluster_v2_kubernetes_clusters_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKubernetesClusterRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KubernetesClusterModel"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Get Kubernetes Cluster

> Get a specific Kubernetes cluster

```json
{"openapi":"3.1.0","info":{"title":"Mithril","version":"1.0.0"},"servers":[{"url":"https://api.mithril.ai"}],"security":[{"MithrilAPIKey":[]}],"components":{"securitySchemes":{"MithrilAPIKey":{"type":"http","scheme":"bearer","bearerFormat":"fkey_<key>"}},"schemas":{"KubernetesClusterModel":{"properties":{"fid":{"type":"string","title":"Fid"},"project":{"type":"string","title":"Project"},"name":{"type":"string","title":"Name"},"region":{"type":"string","title":"Region"},"created_at":{"type":"string","format":"datetime","title":"Created At"},"kube_host":{"type":"string","nullable":true},"ssh_keys":{"items":{"type":"string"},"type":"array","title":"Ssh Keys"},"instances":{"items":{"type":"string"},"type":"array","title":"Instances"},"join_command":{"type":"string","nullable":true},"status":{"type":"string","enum":["Pending","Available","Terminated"],"title":"Status"},"deleted_at":{"type":"string","format":"datetime","nullable":true},"k8s_version":{"type":"string","title":"K8S Version"},"user_fid":{"type":"string","nullable":true}},"type":"object","required":["fid","project","name","region","created_at","ssh_keys","instances","status","k8s_version"],"title":"KubernetesClusterModel"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"oneOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/kubernetes/clusters/{cluster_fid}":{"get":{"tags":["kubernetes clusters"],"summary":"Get Kubernetes Cluster","description":"Get a specific Kubernetes cluster","operationId":"get_kubernetes_cluster_v2_kubernetes_clusters__cluster_fid__get","parameters":[{"name":"cluster_fid","in":"path","required":true,"schema":{"type":"string","title":"Cluster Fid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KubernetesClusterModel"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Delete Kubernetes Cluster

> Delete a Kubernetes cluster

```json
{"openapi":"3.1.0","info":{"title":"Mithril","version":"1.0.0"},"servers":[{"url":"https://api.mithril.ai"}],"security":[{"MithrilAPIKey":[]}],"components":{"securitySchemes":{"MithrilAPIKey":{"type":"http","scheme":"bearer","bearerFormat":"fkey_<key>"}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"oneOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/kubernetes/clusters/{cluster_fid}":{"delete":{"tags":["kubernetes clusters"],"summary":"Delete Kubernetes Cluster","description":"Delete a Kubernetes cluster","operationId":"delete_kubernetes_cluster_v2_kubernetes_clusters__cluster_fid__delete","parameters":[{"name":"cluster_fid","in":"path","required":true,"schema":{"type":"string","title":"Cluster Fid"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mithril.ai/compute-api/compute-api-reference/kubernetes-clusters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
