Advanced15 min
API Documentation
Integrate Lyyli.ai services into your applications and workflows.
Quick Actions
API Overview
REST API
Lyyli.ai provides a RESTful API that supports JSON-formatted requests and responses. All API calls require authentication.
HTTPS
Secure
JSON
Format
OAuth 2.0
Authentication
Authentication
API Keys
Getting an API key:
- Log into your account
- Go to Developer Settings
- Click 'Create API Key'
- Give the key a name and description
- Copy the key securely
Important:
An API key is like a password. Don't share it and store it securely. If a key is compromised, revoke it immediately.
Usage in Headers
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Accept: application/json
Include the Authorization header in all API calls. The API key should be in Bearer token format.
API Endpoints
Base URL:
https://api.lyyli.ai/v1
Assistants
ManagementGET
/assistants
List assistantsPOST
/assistants
Create assistantPUT
/assistants/{id}
Update assistantConversations
CommunicationGET
/conversations
List conversationsPOST
/conversations/{id}/messages
Send messageAnalytics
DataGET
/analytics/usage
Usage dataGET
/analytics/performance
PerformanceCode Examples
JavaScript / Node.js
const response = await fetch('https://api.lyyli.ai/v1/assistants', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
});
const data = await response.json();
Python
import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
response = requests.get(
'https://api.lyyli.ai/v1/assistants',
headers=headers
)
data = response.json()
cURL
curl -X GET \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
"https://api.lyyli.ai/v1/assistants"
Rate Limiting
Free Plan
- • 100 requests/hour
- • Basic features
- • Community support
Pro Plan
- • 1000 requests/hour
- • All features
- • Priority support
Rate limit handling:
When you hit rate limits, the API returns a 429 status code. We recommend implementing exponential backoff.
Error Handling
Common HTTP status codes:
200OK
201Created
204No Content
400Bad Request
401Unauthorized
429Too Many Requests
Error message structure:
{
"error": {
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded",
"retry_after": 3600
}
}
SDKs and Libraries
Official SDKs
- JavaScript/Node.js
- Python
- PHP
Community Libraries
- Ruby
- Go
- Java
Need more help?
If you have questions about using the API or need technical support, contact our developer team.