API Key Authentication
API key authentication is the simplest way to secure your Qdrant instance. You can configure two types of API keys:- Read-Write Key - Full access to all operations
- Read-Only Key - Restricted to read operations (searches, retrievals)
Setting Up API Keys
API keys are configured in theconfig/config.yaml file:
Using API Keys in Requests
Once configured, all API requests must include an API key. There are two ways to provide the key:Method 1: Using the api-key Header (Recommended)
Method 2: Using the Authorization Header
The
api-key header is Qdrant-specific, while the Authorization: Bearer header follows standard OAuth conventions. Both methods are functionally equivalent.Using API Keys with Client Libraries
Read-Write vs Read-Only Keys
Qdrant supports two types of API keys with different permission levels:Read-Write Key
The read-write key (api_key) grants full access to:
- Create, update, and delete collections
- Insert, update, and delete points
- Perform searches and retrievals
- Create and delete snapshots
- Modify cluster configuration
- All administrative operations
Read-Only Key
The read-only key (read_only_api_key) is restricted to:
- List collections and view collection info
- Retrieve points by ID
- Perform vector searches
- Scroll through points
- View cluster information (read-only)
- Creating or deleting collections
- Inserting, updating, or deleting points
- Creating indexes
- Creating snapshots
- Modifying cluster configuration
JWT-Based Access Control (RBAC)
For fine-grained access control, Qdrant supports JWT (JSON Web Token) based authentication with Role-Based Access Control (RBAC).Enabling JWT RBAC
Enable JWT RBAC in your configuration:- The
api_keyis used as the JWT signing secret - You can generate JWT tokens with custom access rules
- Tokens can include collection-level and operation-level permissions
JWT Token Structure
JWT tokens must include anaccess claim defining the allowed operations:
JWT RBAC is an advanced feature. For most use cases, simple API key authentication is sufficient.
TLS Client Certificates
For the highest level of security, Qdrant supports mutual TLS (mTLS) authentication using client certificates.Enabling TLS
Configure TLS in yourconfig/config.yaml:
Mutual TLS (Client Certificates)
To require client certificates for authentication:- Set
verify_https_client_certificate: true - Provide a CA certificate in
tls.ca_cert - Ensure clients present valid certificates signed by the CA
Best Practices
API Key Security
Use strong, random API keys
Use strong, random API keys
Generate API keys using a cryptographically secure random generator:Never use simple or predictable values.
Always use TLS with API keys
Always use TLS with API keys
API keys are sent with every request. Without TLS, they can be intercepted:The configuration file warns: “If you enable this you should also enable TLS.”
Rotate API keys regularly
Rotate API keys regularly
Qdrant supports an alternative API key (
alt_api_key) to enable zero-downtime key rotation:- Add
alt_api_keywith a new key - Update clients to use the new key
- Remove the old
api_keyand promotealt_api_keytoapi_key
Use read-only keys for untrusted clients
Use read-only keys for untrusted clients
Never expose read-write keys to frontend applications or public APIs:
Store keys securely
Store keys securely
Never commit API keys to version control. Use environment variables or secret management:
Network Security
- Firewall rules: Restrict access to Qdrant ports (6333, 6334) using firewall rules
- Private networks: Deploy Qdrant in a private network, not exposed to the public internet
- Reverse proxy: Use a reverse proxy (nginx, Traefik) for additional security layers
- Rate limiting: Implement rate limiting at the proxy or application level
Monitoring Authentication
Qdrant provides audit logging for access-checked API requests:- Authentication method used (API key, JWT, client certificate)
- User/subject information
- Request details and outcomes
- Timestamp and client IP
Next: REST API Reference
Explore the complete REST API documentation
Related Resources
Security Guide
Comprehensive security best practices
Configuration
Complete configuration reference
Distributed Deployment
Secure multi-node clusters
Monitoring
Track authentication events