تسجيل وكيل
curl --request POST \
--url https://api.truthlocks.com/v1/agents \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"display_name": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({display_name: '<string>'})
};
fetch('https://api.truthlocks.com/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/agents"
payload = { "display_name": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/agents"
payload := strings.NewReader("{\n \"display_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_type": "orchestrator",
"display_name": "<string>",
"description": "<string>",
"status": "active",
"scopes": [
"<string>"
],
"metadata": {},
"trust_score": 0.5,
"public_key": "<string>",
"session_count": 123,
"keys": [
{
"kid": "<string>",
"algorithm": "<string>",
"public_key": "<string>",
"status": "active"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}وكلاء الآلة
تسجيل وكيل
تسجيل هوية وكيل آلي جديدة مع زوج مفاتيح تشفير وأذونات محددة النطاق
POST
/
v1
/
agents
تسجيل وكيل
curl --request POST \
--url https://api.truthlocks.com/v1/agents \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"display_name": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({display_name: '<string>'})
};
fetch('https://api.truthlocks.com/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/agents"
payload = { "display_name": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/agents"
payload := strings.NewReader("{\n \"display_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_type": "orchestrator",
"display_name": "<string>",
"description": "<string>",
"status": "active",
"scopes": [
"<string>"
],
"metadata": {},
"trust_score": 0.5,
"public_key": "<string>",
"session_count": 123,
"keys": [
{
"kid": "<string>",
"algorithm": "<string>",
"public_key": "<string>",
"status": "active"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}تسجيل وكيل
POST /v1/agents
يسجل هوية وكيل آلي جديدة للمستأجر المصادق عليه. تنشئ المنصة زوج مفاتيح Ed25519 للوكيل، وتخصص معرف وكيل متوافق مع MAIP، وتسجل المفتاح الأولي في دفتر سجل تاريخ المفاتيح. تبدأ الوكلاء المسجلون حديثًا بحالة active ودرجة ثقة أولية تبلغ 0.500.
يعتمد عدد الوكلاء الذين يمكنك تسجيلهم على خطة الفوترة الخاصة بك. إذا كنت
تجاوز حد خطتك، تُرجع واجهة برمجة التطبيقات
402 Payment Required. اتصل بالمبيعات
لحدود وكيل مستوى المؤسسة.المصادقة
يتطلب رأسX-API-Key أو رمز Bearer JWT. يتم اشتقاق مساحة العمل من بيانات الاعتماد الموثقة؛ لا ترسل X-Tenant-ID.
الاستجابة
معرف وكيل متوافق مع MAIP بالتنسيق
maip:<tenant8>:<ulid>. استخدم هذه القيمة
في جميع استدعاءات API اللاحقة التي تشير إلى هذا الوكيل.مفتاح Ed25519 العام المشفر بـ Base64url الذي تم إنشاؤه لهذا الوكيل. قم بتخزين هذا
بأمان للتحقق من التوقيع.
عمق سلسلة التفويض الحالي. دائمًا
0 للوكلاء المسجلين مباشرة.
الحد الأقصى للعمق هو 8 لكل بروتوكول MAIP.مثال
curl -X POST https://api.truthlocks.com/v1/agents \
-H "X-API-Key: tl_live_..." \
-H "Content-Type: application/json" \
-d '{
"agent_type": "llm",
"display_name": "Customer Support Bot",
"description": "Handles Tier-1 customer support inquiries via chat",
"scopes": ["data:read", "tool:search.web", "!data:delete"],
"metadata": {
"team": "support",
"model": "claude-3.5-sonnet",
"environment": "production"
}
}'
الجسم
application/json
الاستجابة
تم تسجيل الوكيل

