Lyren Docs for Developers
Lyren is a developer-first platform for Chat, Tools, Memory, Knowledge Base, Business, Workflows, Scheduler, Calendar, and Connectors.
Overview
Lyren runs as an HTTP gateway. Your backend calls Lyren using x-api-key. User-scoped features also use x-user-id.
- GET /health — health check
- POST /v1/chat/completions — chat responses
- POST /v1/tools/* — summarize, translate, rewrite, extract, fetch
- POST /v1/memory/* — save, search, forget memory
- POST /v1/knowledge/* — upload and ask from documents
- POST /v1/business/* — lead, churn, revenue insights
- POST /v1/workflows/* — workflow storage
- POST /v1/schedule/* — scheduled jobs
- POST /v1/calendar/* — calendar actions
- POST /v1/connectors/* — connector management
- Call Lyren from your backend
- Keep API keys private
- Pass stable user IDs for user-scoped features
- Use API reference for exact payload shapes
Getting started
Call Lyren from your backend over HTTPS. Every request includes x-api-key. For user-scoped features, also include x-user-id.
- Base URL: https://YOUR_DOMAIN
- API key header: x-api-key
- User id header: x-user-id
Install
Lyren is an HTTP API. Store your credentials in environment variables and send requests from your backend.
- LYREN_BASE_URL — your Lyren server URL
- LYREN_API_KEY — your API key
- LYREN_USER_ID — your application user id
Install (Python)
Use an HTTP client such as httpx.
pip install httpx
export LYREN_BASE_URL="https://YOUR_DOMAIN"
export LYREN_API_KEY="YOUR_API_KEY"
export LYREN_USER_ID="user_123"
import os
import httpx
BASE = os.getenv("LYREN_BASE_URL", "").rstrip("/")
KEY = os.getenv("LYREN_API_KEY", "")
USER_ID = os.getenv("LYREN_USER_ID", "user_123")
def headers(user_scoped: bool = False):
h = {"x-api-key": KEY, "Content-Type": "application/json"}
if user_scoped:
h["x-user-id"] = USER_ID
return h
def chat(prompt: str):
r = httpx.post(
f"{BASE}/v1/chat/completions",
headers=headers(False),
json={
"model": "lyren",
"messages": [{"role": "user", "content": prompt}],
"temperature": 0.4,
"max_tokens": 350
},
timeout=30
)
r.raise_for_status()
return r.json()
if __name__ == "__main__":
res = chat("Say hello from Lyren.")
print(res["choices"][0]["message"]["content"])
Install (Node.js)
Node 18+ includes fetch.
export LYREN_BASE_URL="https://YOUR_DOMAIN"
export LYREN_API_KEY="YOUR_API_KEY"
export LYREN_USER_ID="user_123"
const BASE = (process.env.LYREN_BASE_URL || "").replace(/\/+$/, "");
const KEY = process.env.LYREN_API_KEY || "";
const USER_ID = process.env.LYREN_USER_ID || "user_123";
function headers(userScoped = false) {
const h = { "x-api-key": KEY, "Content-Type": "application/json" };
if (userScoped) h["x-user-id"] = USER_ID;
return h;
}
async function chat(prompt) {
const r = await fetch(`${BASE}/v1/chat/completions`, {
method: "POST",
headers: headers(false),
body: JSON.stringify({
model: "lyren",
messages: [{ role: "user", content: prompt }],
temperature: 0.4,
max_tokens: 350
})
});
if (!r.ok) throw new Error(await r.text());
return r.json();
}
(async () => {
const res = await chat("Say hello from Lyren.");
console.log(res.choices[0].message.content);
})();
Install (cURL)
Use cURL for quick testing.
curl -X POST https://YOUR_DOMAIN/v1/chat/completions \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"model": "lyren",
"messages": [{ "role": "user", "content": "Write 3 bullets about what Lyren can do." }],
"temperature": 0.4,
"max_tokens": 220
}'
Quickstart
- Send a request to POST /v1/chat/completions
- Add x-user-id for user-scoped features
- Use API reference for exact request and response details
curl -X POST https://YOUR_DOMAIN/v1/memory/save \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-user-id: user_123" \
-d '{
"content": "User prefers concise answers and bullet points.",
"tags": "preferences,formatting,style"
}'
Authentication
Every request uses your API key in the x-api-key header.
User identity headers
Memory, Knowledge Base, Business, Workflows, Scheduler, Calendar, and Connectors can be tied to a user. Pass a stable application user id through x-user-id.
Chat
Use Chat for question answering, drafting, explanation, planning, and general assistant behavior in your product.
Tools
Tools provide consistent utility actions such as summarize, translate, rewrite, extract, fetch, and fetch plus summarize.
Memory
Memory stores user preferences and long-term facts. It is user-scoped with /v1/memory/save, /v1/memory/search, and /v1/memory/forget.
Knowledge Base
Upload documents and ask grounded questions from those documents. See the exact developer endpoints in API reference.
Business
Business endpoints return structured insights from your own data, such as lead scoring, churn risk, and revenue leak analysis.
- Lead score
- Churn risk
- Revenue leaks
- History per user
Workflows
Workflows let developers save reusable multi-step definitions for repeated actions inside their apps.
Scheduler
Scheduler lets developers create jobs that run later, such as reminders, follow-ups, and webhook actions.
Calendar
Calendar features support scheduling-related actions such as free/busy lookup, event creation, and booking flows.
Connectors
Connectors let developers store and manage source configurations such as sitemaps, RSS feeds, URL lists, and similar ingestion sources.
Models
The default model name used in examples is lyren.
Errors
Errors return an HTTP status plus a JSON body such as { "error": "...", "message": "..." }.
Limits
Limits are plan-based. When exceeded, the API commonly returns 429.
Frequently Asked Questions
What are Lyren Docs for?
Lyren Docs explain how developers set up, authenticate, and use Lyren modules such as chat, tools, memory, knowledge base, business, workflows, scheduler, calendar, and connectors.
What is the difference between Docs and API Reference?
Docs explain what each part of Lyren does and how to get started. API Reference is for exact routes, headers, request bodies, and response details.
How do I get started with Lyren?
Start by setting your base URL, API key, and user ID if needed. Then send a request to the chat endpoint and use the docs examples for Python, Node.js, or cURL.
How do I authenticate requests to Lyren?
Every request uses your API key in the x-api-key header. User-scoped features also use
x-user-id.
When should I send x-user-id?
Send x-user-id for user-scoped features such as memory, knowledge base, business, workflows,
scheduler, calendar, and connectors.
Can I call Lyren directly from browser JavaScript?
No. The docs state that your Lyren API key should stay on your backend and should not be exposed in browser code.
What languages or clients do the docs support?
The docs include setup and example usage for Python, Node.js, and cURL.
What can I use the chat module for?
Chat can be used for question answering, drafting, explanation, planning, and general assistant behavior inside your product.
What tools are documented in Lyren Docs?
The docs cover tools such as summarize, translate, rewrite, extract, fetch, and fetch plus summarize.
Does Lyren Docs explain memory and knowledge base?
Yes. The docs explain how memory stores user preferences and long-term facts, and how knowledge base supports grounded questions from uploaded documents.
What business features are included in the docs?
The docs explain business capabilities such as lead score, churn risk, revenue leaks, and user-scoped history.
Do the docs explain workflows, scheduler, calendar, and connectors?
Yes. The docs describe how workflows save reusable definitions, scheduler runs delayed jobs, calendar handles scheduling actions, and connectors manage ingestion sources.
What model name is used in the docs examples?
The default model name shown in the docs examples is lyren.
How are errors shown in Lyren Docs?
The docs explain that errors return an HTTP status and a JSON body such as
{ "error": "...", "message": "..." }.
What happens when I exceed limits?
The docs state that limits are plan-based, and when exceeded the API commonly returns a 429 response.