Skip to main content
Version: 0.0.41

LLM API

The LLM API handles chat sessions and language model completions. It is the core interface for conversational AI within Lakehousecat, connecting users to the configured provider models (OpenAI, Anthropic, Google, Azure, AWS Bedrock).

Base URL: http://<host>:42015

What you can do​

  • Create and manage chat sessions
  • Run streaming chat completions against any configured provider model
  • Search, archive, clone, and share chats
  • List available models from all configured providers

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​

curl -X GET "http://localhost:42015/api/v1/llm/models" \
-H "Authorization: Bearer <your-api-key>"
import requests

BASE_URL = "http://localhost:42015"
HEADERS = {"Authorization": "Bearer <your-api-key>"}

response = requests.get(f"{BASE_URL}/api/v1/llm/models", headers=HEADERS)
models = response.json()

Create a new chat session​

curl -X POST "http://localhost:42015/api/v1/llm/chats/new" \
-H "Authorization: Bearer <your-api-key>" \
-H "Content-Type: application/json" \
-d '{"title": "My Chat"}'
response = requests.post(
f"{BASE_URL}/api/v1/llm/chats/new",
json={"title": "My Chat"},
headers=HEADERS,
)
chat = response.json()
chat_id = chat["id"]

Send a chat completion​

curl -X POST "http://localhost:42015/api/v1/llm/chat/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/chat/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 chats​

curl -X GET "http://localhost:42015/api/v1/llm/chats/paginated?page=1&page_size=20" \
-H "Authorization: Bearer <your-api-key>"
response = requests.get(
f"{BASE_URL}/api/v1/llm/chats/paginated",
params={"page": 1, "page_size": 20},
headers=HEADERS,
)
chats = response.json()

Get models from a specific provider​

# Anthropic models
curl -X GET "http://localhost:42015/api/v1/llm/anthropic/models" \
-H "Authorization: Bearer <your-api-key>"

# OpenAI models
curl -X GET "http://localhost:42015/api/v1/llm/openai/models" \
-H "Authorization: Bearer <your-api-key>"
# Available provider endpoints
providers = ["anthropic", "openai", "google", "azure", "aws"]
for provider in providers:
r = requests.get(f"{BASE_URL}/api/v1/llm/{provider}/models", headers=HEADERS)
print(f"{provider}: {r.json()}")

Endpoint Groups​

ResourcePathDescription
Chat Completions/api/v1/llm/chat/completionsRun model completions
Chats/api/v1/llm/chatsSession lifecycle management
Models/api/v1/llm/modelsList all accessible models
Provider Models/api/v1/llm/{provider}/modelsList models by provider

UI Equivalent​

Chat sessions managed via this API correspond to the Sessions workspace in the Lakehousecat UI. Any chat created or modified via API is immediately visible in the UI session list.