Yapay Zeka Analizleri
Zincir durumunu izleme ve eyleme geçirilebilir içgörüler için Chao analiz türleri de dahil olmak üzere, üretkenlik verilerinin yapay zeka tarafından oluşturulan analizlerini talep edin ve alın.
Uç noktalar
| Method | Path | Description | Auth | Rate Limit |
|---|---|---|---|---|
| GET | /ai/analyses | List analyses | JWT + Entitlement | 60/min |
| GET | /ai/analyses/:id | Get an analysis | JWT + Entitlement | 60/min |
| POST | /ai/analyses | Create an analysis | JWT + Entitlement | 10/min |
GET /ai/analyses
Kimliği doğrulanmış kullanıcıya ait tüm analizleri listeleyin.
Rica etmek
- Yetki: JWT Taşıyıcı jetonu + aktif AI yetkisi gerekli
- Hız limiti: 60/dak
- Yol veya sorgu parametresi yok
Cevap
Yanıt Örneği
json
{
"data": [
{
"id": "cm5analysis01",
"type": "streak",
"targetType": "chain",
"targetId": "cm5chain01",
"status": "completed",
"createdAt": "2026-03-17T10:00:00.000Z"
}
],
"meta": {
"total": 1
}
}Yanıt Alanları
| Field | Type | Description |
|---|---|---|
id | string | Analysis ID |
type | string | Analysis type |
targetType | string | Target entity type |
targetId | string | Target entity ID |
status | string | pending, running, completed, failed |
source | string | null | Analysis source (chao, system, manual) |
evidence | array | null | Supporting evidence data |
chainyId | string | null | Linked Chainy ID |
createdAt | string | ISO 8601 |
Kod Örnekleri
bash
curl https://api.chainabit.com/api/v1/ai/analyses \
-H "Authorization: Bearer $TOKEN"javascript
const res = await fetch(`${BASE_URL}/ai/analyses`, {
headers: { Authorization: `Bearer ${TOKEN}` },
});
const { data, meta } = await res.json();python
import requests
res = requests.get(
f"{BASE_URL}/ai/analyses",
headers={"Authorization": f"Bearer {TOKEN}"},
)
body = res.json()GET /ai/analyses/:id
Belirli bir analizin tüm ayrıntılarını ve sonucunu alın.
Rica etmek
- Yetki: JWT Taşıyıcı jetonu + aktif AI yetkisi gerekli
- Hız limiti: 60/dak
- Yol parametreleri:
id— Create an Analysis yanıtındaki (data.id)idyi$ANALYSIS_IDolarak kullanın
Cevap
Yanıt Örneği
json
{
"data": {
"id": "cm5analysis01",
"type": "streak",
"targetType": "chain",
"targetId": "cm5chain01",
"status": "completed",
"result": {
"summary": "Your vocabulary practice chain shows strong consistency with 85% completion rate over the past 6 weeks.",
"insights": [
"You tend to miss completions on weekends",
"Your longest streak was 12 days in February",
"Morning completions correlate with higher retention scores"
],
"recommendations": [
"Set a weekend-specific reminder at 10 AM",
"Consider shorter weekend sessions to maintain streaks"
]
},
"createdAt": "2026-03-17T10:00:00.000Z"
}
}Yanıt Alanları
| Field | Type | Description |
|---|---|---|
id | string | Analysis ID |
type | string | Analysis type |
targetType | string | Target entity type |
targetId | string | Target entity ID |
status | string | pending, running, completed, failed |
source | string | null | Analysis source (chao, system, manual) |
evidence | array | null | Supporting evidence data |
chainyId | string | null | Linked Chainy ID |
result.summary | string | Summary text |
result.insights | string[] | Key insights |
result.recommendations | string[] | Action recommendations |
createdAt | string | ISO 8601 |
Kod Örnekleri
bash
curl https://api.chainabit.com/api/v1/ai/analyses/$ANALYSIS_ID \
-H "Authorization: Bearer $TOKEN"javascript
const analysisId = process.env.ANALYSIS_ID; // id of the analysis to fetch
const res = await fetch(`${BASE_URL}/ai/analyses/${analysisId}`, {
headers: { Authorization: `Bearer ${TOKEN}` },
});
const { data } = await res.json();python
import os
import requests
analysis_id = os.environ["ANALYSIS_ID"] # id of the analysis to fetch
res = requests.get(
f"{BASE_URL}/ai/analyses/{analysis_id}",
headers={"Authorization": f"Bearer {TOKEN}"},
)
data = res.json()["data"]POST /ai/analyses
Hedef varlık için yeni bir yapay zeka analizi oluşturun.
Rica etmek
- Yetki: JWT Taşıyıcı jetonu + aktif AI yetkisi gerekli
- Hız limiti: 10/dak
- "targetId", "targetType"la eşleşen mevcut bir varlığın "kimliği" olmalıdır; ör. Create Chain'den bir zincirin "kimliği", aşağıda "$CHAIN_ID" olarak gösterilmiştir.
Talep Gövdesi
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
type | string | Yes | streak, productivity, routine, time, chainy_health, continuity, blocker, focus, recovery | Analysis type |
targetType | string | Yes | chain, chainy, bit | Target entity type |
targetId | string | Yes | Valid entity ID | ID of the target entity |
dateRange | object | No | ISO 8601 dates | { from: string, to: string } |
Cevap
Yanıt Örneği
json
{
"data": {
"id": "cm5analysis01",
"type": "streak",
"targetType": "chain",
"targetId": "cm5chain01",
"status": "completed",
"result": {
"summary": "Your vocabulary practice chain shows strong consistency with 85% completion rate over the past 6 weeks.",
"insights": [
"You tend to miss completions on weekends",
"Your longest streak was 12 days in February",
"Morning completions correlate with higher retention scores"
],
"recommendations": [
"Set a weekend-specific reminder at 10 AM",
"Consider shorter weekend sessions to maintain streaks"
]
},
"createdAt": "2026-03-17T10:00:00.000Z"
}
}Yanıt Alanları
| Field | Type | Description |
|---|---|---|
id | string | Analysis ID |
type | string | Analysis type |
targetType | string | Target entity type |
targetId | string | Target entity ID |
status | string | pending, running, completed, failed |
source | string | null | Analysis source (chao, system, manual) |
evidence | array | null | Supporting evidence data |
chainyId | string | null | Linked Chainy ID |
result.summary | string | Summary text |
result.insights | string[] | Key insights |
result.recommendations | string[] | Action recommendations |
createdAt | string | ISO 8601 |
Kod Örnekleri
bash
curl -X POST https://api.chainabit.com/api/v1/ai/analyses \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "streak",
"targetType": "chain",
"targetId": "'"$CHAIN_ID"'",
"dateRange": {
"from": "2026-02-01T00:00:00Z",
"to": "2026-03-17T23:59:59Z"
}
}'javascript
const chainId = process.env.CHAIN_ID; // id of the chain to analyze
const res = await fetch(`${BASE_URL}/ai/analyses`, {
method: "POST",
headers: {
Authorization: `Bearer ${TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
type: "streak",
targetType: "chain",
targetId: chainId,
dateRange: {
from: "2026-02-01T00:00:00Z",
to: "2026-03-17T23:59:59Z",
},
}),
});
const { data } = await res.json();python
import os
import requests
chain_id = os.environ["CHAIN_ID"] # id of the chain to analyze
res = requests.post(
f"{BASE_URL}/ai/analyses",
headers={
"Authorization": f"Bearer {TOKEN}",
"Content-Type": "application/json",
},
json={
"type": "streak",
"targetType": "chain",
"targetId": chain_id,
"dateRange": {
"from": "2026-02-01T00:00:00Z",
"to": "2026-03-17T23:59:59Z",
},
},
)
data = res.json()["data"]Chao Analizi Türleri
| Type | Description | Key Output Fields |
|---|---|---|
chainy_health | Composite health score (0-100) from active chain ratio, streak health, velocity, and fragmentation | healthScore, signals, breakdown |
continuity | Identifies chains at risk of streak break, broken streaks, and strong performers | atRisk, broken, strong |
blocker | Detects stalled chains with zero/declining progress | stalled, declining |
routine | Time-of-day and day-of-week completion pattern analysis | peakHours, peakDays, patterns |
focus | Chain attention distribution, identifies neglected vs over-served chains | distribution, neglected, dominant |
recovery | Structured recovery plan for broken streaks with prioritized next actions | recoveryPlan (array of {chainTitle, action, recommendation, priority}) |
Not: Chao analizleri, eyleme dönüştürülebilir bulgular tespit edildiğinde otomatik olarak bekleyen öneriler oluşturabilir. Bu teklifler her zaman kaynak: 'chao' ile oluşturulur ve açık kullanıcı onayı gerektirir; Chao hiçbir zaman değişiklikleri otomatik olarak uygulamaz.