LLM API
The LLM API handles sessions and language model completions. It is the core interface for analytical Q&A within Lakehousecat, connecting users to the configured provider models (OpenAI, Anthropic, Google, Azure, AWS Bedrock, xAI).
Base URL: http://<host>:42015
What you can do
- Create and manage sessions
- Run streaming session completions against any configured provider model
- Search, archive, clone, and share sessions
Authentication
All endpoints require a Bearer token. Generate your API key in the Lakehousecat UI:
Account Settings → Security → API Keys → Generate API Key
Authorization: Bearer <your-api-key>
Quick Start
List available models
Provider and custom models are managed via the LHC Core API, not the LLM service:
curl -X GET "http://localhost:42021/api/v1/lhc/models" \
-H "Authorization: Bearer <your-api-key>"
import requests
LHC_CORE = "http://localhost:42021"
HEADERS = {"Authorization": "Bearer <your-api-key>"}
response = requests.get(f"{LHC_CORE}/api/v1/lhc/models", headers=HEADERS)
models = response.json()
Create a new session
curl -X POST "http://localhost:42015/api/v1/llm/sessions/new" \
-H "Authorization: Bearer <your-api-key>" \
-H "Content-Type: application/json" \
-d '{"title": "My Session"}'
BASE_URL = "http://localhost:42015"
response = requests.post(
f"{BASE_URL}/api/v1/llm/sessions/new",
json={"title": "My Session"},
headers=HEADERS,
)
session = response.json()
session_id = session["id"]
Send a session completion
curl -X POST "http://localhost:42015/api/v1/llm/session/completions" \
-H "Authorization: Bearer <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "What is the total revenue this year?"}
]
}'
response = requests.post(
f"{BASE_URL}/api/v1/llm/session/completions",
json={
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "What is the total revenue this year?"}
],
},
headers=HEADERS,
)
result = response.json()
print(result["choices"][0]["message"]["content"])
List your sessions
curl -X GET "http://localhost:42015/api/v1/llm/sessions/paginated?page=1&page_size=20" \
-H "Authorization: Bearer <your-api-key>"
response = requests.get(
f"{BASE_URL}/api/v1/llm/sessions/paginated",
params={"page": 1, "page_size": 20},
headers=HEADERS,
)
sessions = response.json()
Endpoint Groups
| Resource | Path | Description |
|---|---|---|
| Session Completions | /api/v1/llm/session/completions | Run model completions within a session |
| Sessions | /api/v1/llm/sessions | Session lifecycle management (create, list, archive, clone, share) |
| Models | /api/v1/lhc/models | List all accessible provider and custom models (LHC Core API) |
UI Equivalent
Sessions managed via this API correspond to the Sessions workspace in the Lakehousecat UI. Any session created or modified via API is immediately visible in the UI session list.