When you finish [developing an application](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/open-source/ray/develop-application.md.txt) for your Ray cluster
on Gemini Enterprise Agent Platform, delete the cluster to avoid unnecessary billing.

> [!NOTE]
> **Note:** You can't reuse the cluster name for up to two hours after deleting the cluster.

### Console

1. In the Google Cloud console, go to the Ray on Agent Platform page.

   [Go to the Ray page](https://console.cloud.google.com/vertex-ai/ray)
2. Select the Ray cluster on Gemini Enterprise Agent Platform you want to delete.

3. Click **Delete**.

### Agent Platform SDK for Python

From the same Python environment where you connected to your Ray cluster on
Gemini Enterprise Agent Platform, run the following:

```python
# Shut down the Ray on Agent Platform if currently connected
ray.shutdown()

# Delete cluster
vertex_ray.delete_ray_cluster(CLUSTER_RESOURCE_NAME)
```

Where:

- <var translate="no">CLUSTER_RESOURCE_NAME</var>: CLUSTER_RESOURCE_NAME='projects/{}/locations/{}/persistentResources/{}'.format(<var translate="no">PROJECT_ID</var>, <var translate="no">LOCATION</var>, <var translate="no">CLUSTER_NAME</var>).