Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Evincere/klisk/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Theklisk serve command starts a production server that provides:
- Chat UI at the root URL
- REST API at
/api/chatwith SSE streaming - WebSocket endpoint at
/ws/chat - Embeddable widget via
/widget.js - Health check at
/health - API key authentication (optional)
The production server is optimized for deployment with no file watcher or Studio overhead.
Starting the Server
Basic Usage
$PORT if set):
Custom Port and Host
Serve Specific Project
Chat UI
The production server serves a built-in chat interface at the root URL:- Clean, responsive interface
- Markdown rendering
- Tool call inspection
- File attachments (images, PDFs)
- Real-time streaming
- Conversation history
API Key Authentication
Protect your agent with API keys by setting environment variables:.env
Supported Environment Variables
Main API key for all endpoints
Alternative key specifically for chat endpoints
Alternative key specifically for widget authentication
Health Check
The/health endpoint returns a simple status response:
- Container health checks
- Load balancer probes
- Uptime monitoring
Widget Embedding
Embed your agent as a chat widget on any website:Customization
Configure the widget appearance with data attributes:Widget position:
bottom-right or bottom-leftButton background color (hex or CSS color)
Chat panel width
Chat panel height
API key for authentication (if enabled)
Example: Custom Styled Widget
Environment Variables
The server loads.env from your project directory:
.env
Production Deployment
Docker
Create aDockerfile:
Cloud Run
See the Cloud Run deployment guide for one-command deployment to Google Cloud.Server Architecture
The production server (src/klisk/server/production.py:40-141):
- Loads your project configuration
- Discovers all agents and tools
- Creates a FastAPI app with CORS enabled
- Serves the chat UI static files
- Exposes API endpoints
- Runs with Uvicorn
Unlike
klisk dev, the production server does not include:- File watching / hot reload
- Studio UI
- Agent editing endpoints
Troubleshooting
Port Already in Use
API Keys Not Working
Ensure your.env file is in the project directory:
No Agents Loaded
Runklisk check to validate your project:
- Missing
klisk.config.yaml - Agent definition errors
- Tool import failures
Next Steps
REST API
Integrate your agent via HTTP
Deploy to Cloud Run
One-command deployment to production