The Client class provides an interface to connect to the CyborgDB service and manage encrypted indexes. It allows you to create, list, and interact with encrypted indexes through the CyborgDB REST API.

Creating the Client

To create the client, you need to provide the service URL and an API key for authentication:
from cyborgdb import Client

# Create client with API key
client = Client(
    base_url='http://localhost:8000', 
    api_key='your-api-key'
)
If using the REST API directly, you don’t need to create a client. You can make HTTP requests directly to the service endpoints.

API Key Authentication

To use CyborgDB, you’ll need an API key for authentication. You can get an API key from the CyborgDB Admin Dashboard. The client handles all authentication automatically once you provide the API key during initialization.

Health Checking

You can verify the service connection and health:
# Check service health
try:
    health = client.get_health()
    print("Service status:", health["status"])
except Exception as e:
    print(f"Service unavailable: {e}")

API Reference

For more information on the Client class, refer to the API Reference: