Connect to Clusters
Use a Dedicated cluster endpoint when your application needs the full Collection API, including schema management, insert, upsert, delete, search, query, and hybrid search.
This page demonstrates how to connect to a Dedicated serving cluster. To connect to a Free or Serverless cluster, see Free & Serverless Clusters. For on-demand compute over a project endpoint, see Connect for On-Demand Search.
Endpoint formats
| Cluster type | Endpoint pattern | Notes |
|---|---|---|
| Dedicated | https://{cluster-id}.{region}.vectordb.zillizcloud.com:19530 | Dedicated clusters use the real-time serving endpoint with port 19530. |
Before you begin
Before connecting to a Dedicated cluster, ensure that:
-
You have registered an account with Zilliz Cloud. For details, see Register with Zilliz Cloud.
-
You have created a Dedicated cluster.
-
You have installed a Milvus SDK for your use case. For details, refer to Install SDKs.
-
You have the cluster public endpoint.
-
You have an authentication token. This can be an API key with access to the target cluster or a cluster credential in
username:passwordformat.
You can obtain the cluster public endpoint from the Zilliz Cloud console. Navigate to the Cluster Details page of the target cluster. On the Connect card, copy the cluster public endpoint.
If you use RESTful APIs instead of SDKs, a continuous connection is not established because HTTP follows a request-response communication model.
Install SDKs
Install the SDK for your application language.
pip install pymilvus
For Java, Node.js, and Go projects, install the corresponding Milvus SDK in your project before using the examples below.
Connect to a Dedicated cluster
Use the cluster endpoint and token consistently across SDKs. YOUR_CLUSTER_ENDPOINT is the public endpoint copied from the cluster Connect card, and YOUR_CLUSTER_TOKEN is either an API key with access to the target cluster or a cluster credential in username:password format.
- Python
- Java
- Go
- NodeJS
- cURL
from pymilvus import MilvusClient
CLUSTER_ENDPOINT = "YOUR_CLUSTER_ENDPOINT"
TOKEN = "YOUR_CLUSTER_TOKEN"
client = MilvusClient(
uri=CLUSTER_ENDPOINT,
token=TOKEN,
)
import io.milvus.v2.client.MilvusClientV2;
import io.milvus.v2.client.ConnectConfig;
String CLUSTER_ENDPOINT = "YOUR_CLUSTER_ENDPOINT";
String TOKEN = "YOUR_CLUSTER_TOKEN";
ConnectConfig connectConfig = ConnectConfig.builder()
.uri(CLUSTER_ENDPOINT)
.token(TOKEN)
.build();
MilvusClientV2 client = new MilvusClientV2(connectConfig);
import "github.com/milvus-io/milvus/client/v2/milvusclient"
client, err := milvusclient.New(ctx, &milvusclient.ClientConfig{
Address: "YOUR_CLUSTER_ENDPOINT",
APIKey: "YOUR_CLUSTER_TOKEN",
})
const { MilvusClient } = require("@zilliz/milvus2-sdk-node");
const address = "YOUR_CLUSTER_ENDPOINT";
const token = "YOUR_CLUSTER_TOKEN";
const client = new MilvusClient({ address, token });
curl --request POST \
--url "YOUR_CLUSTER_ENDPOINT" \
--header "Authorization: Bearer YOUR_CLUSTER_TOKEN" \
--header "Content-Type: application/json" \
--data '{"dbName": "default"}'
Verify the connection
After connecting with an SDK, run a lightweight operation such as listing collections.
collections = client.list_collections()
print(collections)
Next steps
Once connected, use the same client instance to create collections, load data, and run real-time search or query operations against the Dedicated cluster.
For Free or Serverless serving clusters, see Free & Serverless Clusters. For on-demand compute through a project endpoint, see Connect for On-Demand Search.