Overview
Purpose of the API
The API allows external systems, tools and agents to access the LogicBasis core directly. Every request requires a valid API key.
Authentication
Bearer Key
API keys are sent as Bearer tokens and stored internally as SHA‑256 hashes. No plaintext, no uploads, no GitHub.
Authorization: Bearer lb_XXXXXXXXXXXXXXXX Content-Type: application/json
Endpoints
German & English
POST https://app.logicbasis.ch/api/chat POST https://app.logicbasis.ch/api/chat-en
{
"message": "Your input",
"sessionId": "optional"
}Parameters
message & sessionId
- message – string, required
- sessionId – string, optional (enables memory)
Response
JSON Structure
{
"reply": "Response from LogicBasis"
}Error Codes
Deterministic
- 200 – Soft error (missing message, inactive plan)
- 401 – Invalid API key
- 429 – Monthly limit reached
- 500 – Technical error
Limits
Standard & Plus
- Standard: 1000 requests / month
- Plus: 5000 requests / month
- Reset: 1st day of each month
Examples
JS / Python / cURL
await fetch("https://app.logicbasis.ch/api/chat", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({ message: "Hello LogicBasis" })
});Security
API Key Protection
- Never use API keys in client‑side code
- Never upload API keys to GitHub
- Treat API keys like passwords
- Regenerate immediately if compromised