SWASENA
api reference
Authentication
None — Local deployment
Rate Limit
10 requests / minute
Format
application/json
Language
Arabic · English
Endpoints
POST /api/chat إرسال رسالة واستقبال رد سواسينا
REQUEST BODY
{
  "message": "مرحبا سواسينا"
}
RESPONSE 200
{
  "reply": "مرحباً! كيف يمكنني..."
}
RESPONSE 403 · Blocked
{
  "error": "⚠️ هذا المحتوى...",
  "arabic_block": true
}
RESPONSE 429 · Rate Limited
{
  "error": "🚫 ممنوع 540 ثانية",
  "blocked_until": 540,
  "arabic_block": true
}
GET /api/metrics مقاييس أداء الخادم
RESPONSE 200
{
  "avg_response_ms": 842,
  "uptime_seconds": 3600,
  "total_requests": 58
}
GET /api/governance حالة طبقة الحوكمة المحلية
RESPONSE 200
{
  "loaded": true,
  "device": "mps",
  "clients_count": 2,
  "clients": ["client-v1"],
  "models_root": "~/Desktop/..."
}
GET /api/rate_limit_status حالة حظر الـ IP الحالي
RESPONSE 200
{
  "blocked_until_seconds": 0
}
GET /api/garden بيانات الذاكرة العاطفية
RESPONSE 200
{
  "memories": [{
    "text": "حياران",
    "options": ["تتذكرك دائماً", "لا تتذكر"],
    "emotion": 0.75
  }]
}
Rate Limiting
10
REQUESTS / MINUTE
10 min
BLOCK DURATION
Per IP
SCOPE
In-Memory
STORAGE