Skip to main content
Version: Next

Authentication & Setup

This guide covers how to generate an API key, authenticate requests, and verify that all services are reachable before starting an integration.

Generate an API Key​

API keys are generated in the Lakehousecat UI — no API call is required to create one.

  1. Log in to Lakehousecat
  2. Open Account Settings → Security → API Keys
  3. Click Generate API Key
  4. Copy the key and store it in a secure location

The key does not expire with your browser session. If you regenerate it, the previous key is immediately invalidated.

Set Up Your Environment​

Store the key and the service base URLs in environment variables:

export LHC_TOKEN="lhc_..."

# Service base URLs (adjust to your deployment)
export LHC_CORE="http://localhost:42021"
export LHC_LLM="http://localhost:42020"
export LHC_ANALYTICS="http://localhost:42019"
export LHC_SEMANTIC="http://localhost:42118"
import os, requests

TOKEN = os.environ["LHC_TOKEN"]
HEADERS = {"Authorization": f"Bearer {TOKEN}"}

CORE = "http://localhost:42021"
LLM = "http://localhost:42020"
ANALYTICS = "http://localhost:42019"
SEMANTIC = "http://localhost:42118"

Verify Connectivity​

Check that all services are reachable:

curl -s "$LHC_CORE/health"      # → {"status":"ok"}
curl -s "$LHC_LLM/health" # → {"status":"ok"}
curl -s "$LHC_ANALYTICS/health" # → {"status":"ok"}
curl -s "$LHC_SEMANTIC/health" # → {"status":"ok"}
for name, base in [("Core", CORE), ("LLM", LLM), ("Analytics", ANALYTICS), ("Semantic", SEMANTIC)]:
r = requests.get(f"{base}/health")
print(f"{name}: {r.json()}")

Verify Authentication​

Confirm the API key is valid by fetching your user profile:

curl -s "$LHC_CORE/api/v1/lhc/users/user/info" \
-H "Authorization: Bearer $LHC_TOKEN"
me = requests.get(f"{CORE}/api/v1/lhc/users/user/info", headers=HEADERS).json()
print(me["name"], me["role"])

A successful response returns your user profile including id, name, email, and role. A 401 response indicates an invalid or missing token.

Next Steps​

With authentication working, proceed to the main integration scenarios: