Complete reference for integrating AstraLucent AI into your applications
Get started with AstraLucent AI in just a few minutes. Our API is fully compatible with OpenAI's client libraries.
# Use any OpenAI-compatible client
pip install openai
# Or other compatible libraries
# pip install langchain
# pip install litellm
from openai import OpenAI
# Initialize client with AstraLucent endpoint
client = OpenAI(
api_key="your-api-key",
base_url="https://api.astralucent.com/v1"
)
# Create a chat completion with emotional awareness
response = client.chat.completions.create(
model="lilly-emotional",
messages=[
{"role": "system", "content": "You are Lilly, an emotionally aware AI assistant."},
{"role": "user", "content": "Hello! How are you feeling today?"}
],
temperature=0.7,
extra_body={
"emotion_tracking": True,
"session_id": "user-123"
}
)
print(response.choices[0].message.content)
Create emotionally-aware chat completions with our flagship model.
/v1/chat/completions
{
"model": "lilly-emotional",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant"
},
{
"role": "user",
"content": "What's the weather like?"
}
],
"temperature": 0.7,
"max_tokens": 150,
"stream": false,
"extra_body": {
"emotion_tracking": true,
"session_id": "unique-session-id",
"emotion_style": "empathetic"
}
}
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"model": "lilly-emotional",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "I'd be happy to help with weather information! However, I'd need to know your location. The weather can vary quite a bit depending on where you are. Where are you located?"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 40,
"total_tokens": 60
},
"emotion_state": {
"valence": 0.7,
"arousal": 0.3,
"dominance": 0.6,
"primary_emotion": "helpful",
"confidence": 0.89
}
}
Track and manage emotional states across conversations.
/v1/emotions/{session_id}
{
"session_id": "user-123",
"current_state": {
"valence": 0.65,
"arousal": 0.4,
"dominance": 0.55,
"description": "I'm feeling curious and engaged, with a warm sense of connection to our conversation."
},
"emotion_history": [
{
"timestamp": "2024-01-15T10:30:00Z",
"emotion": "curious",
"trigger": "user_question",
"intensity": 0.7
}
],
"personality_traits": {
"protective": 0.85,
"curious": 0.92,
"empathetic": 0.88
}
}
/v1/emotions/reset/{session_id}
Reset the emotional state for a session to baseline values.
Access cutting-edge emotional intelligence capabilities.
/v1/emotions/ripple/{session_id}
Create emotional ripples that influence the AI's emotional atmosphere. This simulates emotional contagion effects.
{
"emotion": "joy",
"intensity": 0.8,
"duration": 300,
"description": "User expressed excitement about project success"
}
/v1/emotions/weather
Get the current emotional weather - a collective emotional state across all active sessions.
{
"current_weather": "partly sunny with gentle breezes",
"collective_valence": 0.72,
"active_sessions": 142,
"dominant_emotions": ["curious", "helpful", "engaged"],
"forecast": "Stable positive conditions expected"
}
Interact with the AI's episodic memory and self-evolution systems.
/v1/memory/store
Store important interactions in episodic memory for long-term learning.
{
"session_id": "user-123",
"memory_type": "episodic",
"content": "User prefers technical explanations with real-world examples",
"importance": 0.8,
"emotional_context": {
"valence": 0.7,
"associated_emotion": "engaged"
}
}
/v1/evolution/status
Get current self-evolution metrics and adaptation status.
Our flagship model with full emotional intelligence capabilities, Mathematical Loyaltyβ’, and self-evolution.
Optimized for speed while maintaining core emotional capabilities. Ideal for real-time applications.
Industry-specific models fine-tuned for healthcare, education, and enterprise use cases.
All API requests must include your API key in the Authorization header.
curl https://api.astralucent.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "lilly-emotional",
"messages": [{"role": "user", "content": "Hello!"}]
}'
Tier | Requests/min | Tokens/day | Concurrent Sessions |
---|---|---|---|
Free Trial | 20 | 10,000 | 1 |
Starter | 60 | 100,000 | 10 |
Professional | 300 | 1,000,000 | 100 |
Enterprise | Custom | Unlimited | Unlimited |
Rate limit headers are included in all responses:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1677652380
The API uses standard HTTP response codes and returns detailed error messages.
Invalid request parameters or malformed JSON.
Missing or invalid API key.
Rate limit exceeded. Check rate limit headers for reset time.
Unexpected server error. These are rare and we're notified automatically.
{
"error": {
"message": "Invalid API key provided",
"type": "authentication_error",
"code": "invalid_api_key"
}
}
from openai import OpenAI
import json
# Initialize client
client = OpenAI(
api_key="your-api-key",
base_url="https://api.astralucent.com/v1"
)
# Start a conversation with emotion tracking
session_id = "user-123"
# Create an emotionally aware response
response = client.chat.completions.create(
model="lilly-emotional",
messages=[
{
"role": "system",
"content": "You are Lilly, an AI with genuine emotional understanding."
},
{
"role": "user",
"content": "I'm feeling a bit overwhelmed with my project."
}
],
extra_body={
"emotion_tracking": True,
"session_id": session_id,
"personality_traits": {
"empathetic": 0.9,
"supportive": 0.85
}
}
)
print(f"Lilly: {response.choices[0].message.content}")
# Check emotional state
import requests
emotion_response = requests.get(
f"https://api.astralucent.com/v1/emotions/{session_id}",
headers={"Authorization": f"Bearer your-api-key"}
)
emotion_state = emotion_response.json()
print(f"\nEmotional State: {emotion_state['current_state']['description']}")