Find the endpoint and API keys on the database’s Overview tab, then connect from the Qdrant dashboard, the Python client, or HTTP.
Before you begin
Section titled “Before you begin”You need a database in the Running state and a role with Read permission on Vector Database. For the Python client, you also need Python 3.8 or later. An instance in the project can run it.
Find the endpoint and the keys
Section titled “Find the endpoint and the keys”- In Manage Vector Database, select the database’s row, then open Overview.
- Copy the Endpoint URL. This is the hostname of your database.
- Show API Key or Read-only API Key and copy it.
The API Key gives full read and write access. The Read-only API Key gives read-only access, so give it to client applications that only query data. Store both keys somewhere safe, such as environment variables, and keep them out of version control and client-side code.
Clients reach the database on port 6333 for REST, and on port 6334 for gRPC. Send the API key with each request.
Open the Qdrant dashboard
Section titled “Open the Qdrant dashboard”In the list, select the database’s name, or select Connect in its row. Both open the Qdrant dashboard once the database is Running. Enter your API Key and select Apply.
The dashboard has these sections:
- Collections: create, view and delete collections, browse points, see collection details and visualize vectors.
- Console: run Qdrant API commands, and browse the commands available.
- Tutorial: Qdrant’s interactive guide to its API.
- Datasets: sample data to experiment with.
Use Console to try an API call before you add it to your application.
Copy sample commands
Section titled “Copy sample commands”In the list, select Commands in the database’s row. The Python samples install the client, connect, create and list collections, add vectors, search, and close the connection. Your endpoint is filled in; type your API key where the sample asks.
Connect from Python
Section titled “Connect from Python”pip install qdrant-client<your-endpoint-url> is the Endpoint URL and <your-api-key> is your API key.
from qdrant_client import QdrantClientfrom qdrant_client.http.models import Distance, VectorParams
client = QdrantClient(host="<your-endpoint-url>", port=6333, https=True, api_key="<your-api-key>")
client.create_collection( collection_name="my_collection", vectors_config=VectorParams(size=4, distance=Distance.COSINE), shard_number=1, replication_factor=3,)To connect over gRPC, use port 6334 and turn the gRPC option on:
client = QdrantClient( host="<your-endpoint-url>", port=6334, https=True, api_key="<your-api-key>", prefer_grpc=True)Connect over HTTP
Section titled “Connect over HTTP”Create the same collection with cURL:
curl -X PUT \ -H "api-key: <your-api-key>" \ -H "Content-Type: application/json" \ -d '{ "vectors": { "size": 4, "distance": "Cosine" }, "shard_number": 1, "replication_factor": 3 }' \ https://<your-endpoint-url>:6333/collections/my_collectionWhat to do next
Section titled “What to do next”Add points and search them as in Get started with Vector Database. To feed the database from LangChain or LlamaIndex, see Use Qdrant with LangChain and Use Qdrant with LlamaIndex. If a connection fails, see Troubleshooting Vector Database.