v1.0.0 Stable

API Reference & Integrations

Automate your data annotation and human-in-the-loop workflows by integrating Radiif directly into your ML training pipeline.

Base Endpoint

https://api.radiif.com/v1

Getting Started

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

All API requests must contain your organization token in the Authorization header. You can obtain your API key from the developer settings page in your dashboard.

Authorization: Bearer YOUR_ORGANIZATION_TOKEN

Create Task

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

Example Request

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);

Get Results

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.