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 optionally an API key for authentication:
from cyborgdb import Client

# Create client with API key (for production)
client = Client('http://localhost:8000', 'your-api-key')

# Create client without API key (for local development)
local_client = Client('http://localhost:8000', None)
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

For production deployments, 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.

Service Connection

The client connects to the CyborgDB service via HTTP/HTTPS. All data transmission is secured, and all index data is end-to-end encrypted before being sent to the service.
  • Local Development: Use http://localhost:8000 without an API key when running the service locally
  • Production: Use your hosted service URL with an API key for authentication

Health Checking

You can verify the service connection and health:
# Note: get_health() is not yet implemented in Python SDK
# Use try/catch with any operation to verify connection
try:
    indexes = client.list_indexes()
    print("Service is healthy")
except Exception as e:
    print(f"Service unavailable: {e}")

API Reference

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