The Lyralink Dataset API gives operators and developers programmatic access to the Lyralink Q&A knowledge base — retrieve semantically relevant results for RAG pipelines, chatbot grounding, or custom search features in your deployment.
All requests require an API key. Keys are free to generate from your account dashboard. Rate limits scale with your operator tier.
Pass your API key using any of these methods — all are equivalent:
Option 1 — Query parameter
http://lyralinkai.com/api/public_api.php?q=hello&key=lyr_your_key_here
Option 2 — X-API-Key header
X-API-Key: lyr_your_key_here
Option 3 — Authorization Bearer header
Authorization: Bearer lyr_your_key_here
{
"error": {
"code": "INVALID_KEY",
"message": "Invalid API key."
}
}
| HTTP Status | Error Code | Meaning |
|---|---|---|
| 400 | MISSING_QUERY | The ?q= parameter is missing |
| 400 | QUERY_TOO_LONG | Query exceeds 500 characters |
| 401 | MISSING_KEY | No API key provided |
| 401 | INVALID_KEY | Key not found or incorrect |
| 403 | KEY_DISABLED | Key has been revoked |
| 429 | RATE_LIMITED | Daily request limit reached |
| 503 | DB_ERROR | Service temporarily unavailable |
Your rate limit is determined by your Lyralink account plan. Rate limit headers are included on every response:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1740873600
| Plan | Requests / Day | Notes |
|---|---|---|
| Free | 100 | Default for all accounts |
| Basic | 500 | $5/mo |
| Pro | 2,000 | $15/mo |
| Enterprise | 10,000 | $30/mo — LLaMA 70b access + recommended for production operator deployments |
Returns the most relevant Q&A entries from the dataset for a given query. Uses keyword matching with embedding similarity as a fallback.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
q |
string | required | Your search query. Max 500 characters. |
key |
string | required* | Your API key. Can also be passed as a header. |
limit |
integer | optional | Number of results to return. Default: 3, max: 10. |
Example Response
{
"object": "search_results",
"query": "how does photosynthesis work",
"count": 2,
"results": [
{
"id": 42,
"question": "Can you explain photosynthesis simply?",
"answer": "Photosynthesis is how plants convert sunlight...",
"score": 2.8431,
"method": "keyword"
},
{
"id": 17,
"question": "What do plants need to make food?",
"answer": "Plants need sunlight, water, and CO2...",
"score": 0.7812,
"method": "embedding"
}
],
"meta": {
"plan": "free",
"requests_today": 4,
"requests_limit": 100,
"requests_remaining": 96
}
}
Result fields
| Field | Type | Description |
|---|---|---|
id | integer | Unique dataset entry ID |
question | string | The stored question |
answer | string | The stored answer |
score | float | Relevance score — higher is more relevant |
method | string | keyword, like, or embedding |
cURL
curl -G http://lyralinkai.com/api/public_api.php \
--data-urlencode "q=how does AI work" \
-d "key=lyr_your_key_here" \
-d "limit=3"
JavaScript (fetch)
const response = await fetch(
'http://lyralinkai.com/api/public_api.php?q=how+does+AI+work&limit=3',
{ headers: { 'X-API-Key': 'lyr_your_key_here' } }
);
const data = await response.json();
data.results.forEach(result => {
console.log(result.question);
console.log(result.answer);
console.log(`Score: ${result.score} via ${result.method}`);
});
Python (requests)
import requests
response = requests.get(
"http://lyralinkai.com/api/public_api.php",
params={"q": "how does AI work", "limit": 3},
headers={"X-API-Key": "lyr_your_key_here"}
)
data = response.json()
for result in data["results"]:
print(result["question"])
print(result["answer"])
print(f"Score: {result['score']} via {result['method']}")