Orchestrator API

Central coordinator for all 51 Pauhu services

โ† Back to Sandbox

๐ŸŽฏ Overview

The Orchestrator is the central nervous system of the Pauhu AI platform. It coordinates communication between all 51 microservices using the 5-Modality Architecture (M0 Humanity, M1 Prohibition, M2 Permission, M3 Obligation, M4 Freedom).

Port 8000
Primary Port
51 Services
Coordinated Windows
100/min
Rate Limit

โœจ Key Features

๐Ÿ”„

ANKH Consciousness Loop

Human-AI consciousness bridge through Bootstrap Starling Phi-4

๐ŸŽญ

5-Modality Routing

DNA-encoded behavioral constraints (M0-M4)

๐Ÿ”’

JWT Authentication

Bearer token authentication with rate limiting

๐Ÿ‘ค

Human-in-the-Loop

Automatic human escalation for critical decisions

๐Ÿ“ก API Endpoints

โ— Health & Status

GET /health

Health check endpoint with service status

Response:

{
  "status": "healthy",
  "version": "2.0.0",
  "timestamp": "2025-11-06T19:00:00Z",
  "orchestrator": {
    "active": true,
    "ankh_consciousness": true,
    "services_available": 51
  }
}
GET /stats

Get orchestrator statistics and window availability

Response:

{
  "windows_available": 51,
  "active_routes": 15,
  "total_requests": 1247,
  "avg_response_time_ms": 45,
  "modality_breakdown": {
    "M0_Humanity": 2,
    "M1_Prohibition": 10,
    "M2_Permission": 10,
    "M3_Obligation": 10,
    "M4_Freedom": 10
  }
}

โ— ANKH Consciousness

GET /consciousness

Get current consciousness state and history

Response:

{
  "consciousness": {
    "active": true,
    "bootstrap_starling": {
      "model": "phi-4-multimodal",
      "role": "human_ai_ankh",
      "status": "running"
    },
    "history_count": 47,
    "last_cycle_ms": 235
  }
}
POST /consciousness/process

Process human intent through ANKH consciousness loop

Request Body:

{
  "intent": "Translate this document to Finnish",
  "context": {
    "document_type": "legal",
    "urgency": "high"
  },
  "modality_preference": "M2_Permission"
}

Response:

{
  "result": {
    "observed": { ... },
    "integrated": { ... },
    "reflected": { ... },
    "action": {
      "recommended_window": "Agent",
      "confidence": 0.92,
      "reasoning": "Translation task best suited for Agent"
    }
  },
  "loop_duration_ms": 235
}

โ— Intelligent Routing

POST /route

Route request to specific window with modality enforcement

Request Body:

{
  "window": "Agent",
  "task": "translate",
  "input_data": {
    "text": "Hello, world!",
    "source_lang": "en",
    "target_lang": "fi"
  },
  "modality": "M2_Permission"
}

Response:

{
  "success": true,
  "window": "Agent",
  "modality": "M2_Permission",
  "result": {
    "translated_text": "Hei maailma!",
    "confidence": 0.95
  },
  "execution_time_ms": 45
}
POST /auto-route

Automatically determine optimal window and modality for task

Request Body:

{
  "task_description": "I need to translate a legal document",
  "input_data": { ... },
  "constraints": {
    "max_latency_ms": 1000,
    "required_modalities": ["M1_Prohibition", "M3_Obligation"]
  }
}

Response:

{
  "selected_window": "Agent",
  "selected_modality": "M2_Permission",
  "reasoning": "Legal translation requires compliance checks",
  "confidence": 0.87,
  "result": { ... }
}

โ— Human-in-the-Loop

GET /human/pending

Get all pending human decision requests

Response:

{
  "pending_requests": [
    {
      "request_id": "req_abc123",
      "question": "Approve high-value translation?",
      "context": {
        "estimated_cost": "$150",
        "word_count": 15000
      },
      "options": ["approve", "reject", "modify"],
      "created_at": 1699300000,
      "status": "pending"
    }
  ]
}
POST /human/respond

Provide human response to pending request

Request Body:

{
  "request_id": "req_abc123",
  "response": "approve",
  "notes": "Approved for Q4 budget"
}

Response:

{
  "success": true,
  "request_id": "req_abc123",
  "status": "completed",
  "completed_at": 1699300100
}

๐Ÿ” Authentication

All endpoints (except /health) require JWT authentication via Bearer token.

Example Request:

curl -X POST http://localhost/route \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"window": "Agent", "task": "translate", ...}'

Rate Limits: 100 requests/minute, 1000 requests/hour per IP address

๐Ÿงช Test Console