v1.0.0 Stable

المستندات البرمجية وأدوات الربط (API)

قم بأتمتة عمليات ترميز البيانات ومراجعة النماذج (Human-in-the-Loop) عن طريق ربط منصة رديف مباشرة بخط إنتاج التعلم الآلي الخاص بك.

نقطة النهاية الرئيسية (Base Endpoint)

https://api.radiif.com/v1

البداية السريعة

Welcome to the Radiif developer portal. Our API enables technology partners, AI labs, and enterprise clients to connect directly to our Saudi expert annotation network. By using the API, you can programmatically request annotation work, deliver RLHF prompts, track tasks in real-time, and download finalized datasets directly into your machine learning pipelines.

التحقق والمصادقة (Authentication)

يجب أن تحتوي جميع طلبات واجهة برمجة التطبيقات (API) على رمز مؤسستك في ترويسة الطلب (Authorization Header). يمكنك الحصول على مفتاح الواجهة من إعدادات المطورين في لوحة التحكم الخاصة بك.

Authorization: Bearer YOUR_ORGANIZATION_TOKEN

إنشاء مهمة

Start a new annotation or RLHF preference task by sending a POST request to `/tasks`. Provide task guidelines, prompt lists, and language preferences.

معاملات الطلب (Request Parameters)

Field
Type
Required
task_type
string
Yes
prompts
array
Yes
guidelines
string
No

نموذج برمجى للطلب

curl -X POST https://api.radiif.com/v1/tasks \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "task_type": "rlhf_ranking",
    "prompts": [
      {
        "prompt": "Explain the rules of PDPL in simple terms.",
        "completions": ["Model response A...", "Model response B..."]
      }
    ],
    "guidelines": "Ensure safety, cultural alignment, and correctness."
  }'
import requests

url = "https://api.radiif.com/v1/tasks"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json"
}
payload = {
    "task_type": "rlhf_ranking",
    "prompts": [
        {
            "prompt": "Explain PDPL rules in simple terms.",
            "completions": ["Completion A...", "Completion B..."]
        }
    ]
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
$ch = curl_init("https://api.radiif.com/v1/tasks");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer YOUR_TOKEN",
    "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    "task_type" => "rlhf_ranking",
    "prompts" => [
        [
            "prompt" => "Explain PDPL rules in simple terms.",
            "completions" => ["A", "B"]
        ]
    ]
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = json_decode(curl_exec($ch), true);

استلام النتائج

Once experts submit evaluations, the tasks change status to `completed`. You can retrieve results using a GET request for a specific task.

GET /tasks/{task_id}

صيغة الاستجابة (Response Format)

{
  "task_id": "task_9281a82b",
  "status": "completed",
  "results": [
    {
      "prompt": "Explain PDPL rules in simple terms.",
      "best_completion_index": 0,
      "annotations": {
        "rationale": "Completion A includes detailed local hosting requirements, while B lacks SA hosting details."
      }
    }
  ]
}

التنبيهات الفورية (Webhooks)

Configure a webhook URL under your dashboard developers section. Radiif will send a POST request with payload signatures whenever task groups complete processing, allowing your ML infrastructure to automatically pull dataset outputs and trigger retraining.