oorr / api platform
.open {API}

DEVELOPER PLATFORM05 — Chat

Chat Live

OORR API Platform Sargon 1.5

POST /api/tutor

Returns one complete answer as JSON. This is the simplest way to call OORR and the right default for server-to-server use.

curl -X POST https://api.oorr.ai/api/tutor \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "student_4821",
    "message": "وما وحدة قياسها؟",
    "plan": "normal",
    "modelTier": "basic",
    "conversationId": "conv_7f3a",
    "history": [
      { "role": "user", "content": "اشرح قانون أوم بإيجاز" },
      { "role": "assistant", "content": "قانون أوم ينص على أن..." }
    ]
  }'

Response

200 OK
{
  "answer": "وحدة قياس المقاومة هي الأوم (Ω)، وتُعرَّف بأنها...",
  "model": "sargon-1.5",
  "inputTokens": 412,
  "outputTokens": 735,
  "totalTokens": 1147,
  "latencyMs": 4210,
  "requestId": "0f4c1b86-27a1-4f1e-9d0a-2b7c6e5a1d33",
  "modelTier": "basic"
}

Streaming

POST /api/tutor/stream

Identical request body. Validation and rate-limit failures are still ordinary JSON HTTP errors; once the request is accepted the response becomes text/event-stream.

EventDataMeaning
ready{}Stream opened.
status{ stage, detail?, sequence }Progress frame from a closed allowlist of stages. Carries no answer text.
delta{ text }An answer fragment. Concatenate in order.
trialPro-trial statusEmitted for pro requests.
doneFull response objectTerminal. Same shape as the JSON endpoint, including token counts.
error{ error, code, requestId }Terminal failure after the stream opened.

status.stage is one of accepted, context, intent, preparing, alternate_path, retrying, quality_check, answer_ready. detail appears only for context (fresh | followup) and intent (concise, explain_more, quiz, image, general).

event: ready
data: {}

event: status
data: {"stage":"accepted","sequence":1}

event: status
data: {"stage":"context","detail":"fresh","sequence":2}

event: delta
data: {"text":"قانون أوم "}

event: delta
data: {"text":"ينص على أن..."}

event: done
data: {"answer":"قانون أوم ينص على أن...","model":"sargon-1.5","inputTokens":318,"outputTokens":602,"totalTokens":920,"latencyMs":3870,"requestId":"9a2e...","modelTier":"basic"}