Advanced15 min

API Documentation

Integrate Lyyli.ai services into your applications and workflows.

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:

  1. Log into your account
  2. Go to Developer Settings
  3. Click 'Create API Key'
  4. Give the key a name and description
  5. 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

Management
GET/assistantsList assistants
POST/assistantsCreate assistant
PUT/assistants/{id}Update assistant

Conversations

Communication
GET/conversationsList conversations
POST/conversations/{id}/messagesSend message

Analytics

Data
GET/analytics/usageUsage data
GET/analytics/performancePerformance

Code 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.

API Documentation - Integrate with Lyyli.ai | Lyyli.ai