API Reference

🌐 Sovereign OS REST API Reference

🏠 Home | πŸŽ›οΈ Console | πŸ€– Copilot | πŸ“ Architecture | βš™οΈ Subsystems | 🌐 API Reference | πŸ’» REPL Commands | ☸️ K8s CRDs | πŸ›‘οΈ Invariants & Rules | πŸ”„ Bi-Directional Sync

---

1. Remote Execution & SCTL

POST /remote/submit

Enqueues a remote execution ticket.

  • **Request Body**: RemoteTicketRequest
  • `json

    {

    "lane": "Fast",

    "prompt": "Inspect node health",

    "priority": 10

    }

    `

  • **Response**: RemoteTicketResponse
  • POST /remote/execute

    Executes an atomic instruction immediately across the cluster mesh.

  • **Request Body**: RemoteExecutionRequest
  • **Response**: RemoteExecutionResult
  • ---

    2. Mesh & Operator Console

    GET /mesh/ledger

    Returns the complete list of mesh ledger entries and peer state transitions.

  • **Response**: Vec<MeshLedgerEntry>
  • GET /console/dashboard

    Returns the synthesized real-time operator console dashboard.

  • **Response**: OperatorDashboard
  • POST /api/repl/execute

    Executes an interactive CLI command on the sovereign kernel REPL (e.g. vitality, rules, balance, hud-master).

  • **Request Body**:
  • `json

    {

    "command": "vitality",

    "args": []

    }

    `

  • **Response**:
  • `json

    {

    "status": "ok",

    "stdout": "substrate vitality = 6.22\nSubstrate Vitality Slope ($S_v$) = 7.16 / 9.90",

    "stderr": ""

    }

    `

    ---

    3. PQR Economic Substrate

    POST /pqr/wallet/balance

    Queries the PQR Coin balance for an account.

  • **Request Body**:
  • `json

    { "account_id": "operator" }

    `

  • **Response**: WalletBalanceResponse
  • POST /pqr/mission/balance

    Queries the locked escrow balance for a mission contract.

  • **Request Body**:
  • `json

    { "mission_id": "mission-alpha" }

    `

  • **Response**: MissionBalanceResponse
  • POST /pqr/transfer

    Executes an atomic transfer of PQR Coin between accounts.

  • **Request Body**:
  • `json

    {

    "from": "alice",

    "to": "bob",

    "amount": 100

    }

    `

  • **Response**: Result<TransferResponse, String>
  • POST /pqr/reward

    Mints or disburses a verified mission completion reward.

  • **Request Body**: RewardRequest
  • **Response**: RewardResponse
  • ---

    4. Cognitive Execution

    POST /cog/execute

    Dispatches a prompt through the hybrid multi-model Cognitive Bridge.

  • **Request Body**:
  • `json

    {

    "lane": "Deep",

    "prompt": "Synthesize macroeconomic balance deltas",

    "mission_id": "m-001"

    }

    `

  • **Response**: CognitiveExecutionResult
  • ---

    5. Master Cockpit & HUD Unification

    GET /hud/master & POST /hud/master

    Generates the comprehensive unified master HUD snapshot consolidating all 12 subsystems.

  • **Response**: HudMasterSnapshot JSON
  • GET /hud/audit & POST /hud/audit

    Executes field-level verification across all HUD subsystems, confirming 0 stale or static mock fields.

  • **Response**: HudAuditReport
  • ---

    6. Autonomic Playbooks & Policies

    GET /autonomic/playbooks

    Lists all registered autonomic playbooks.

  • **Response**: Vec<Playbook>
  • POST /autonomic/playbooks

    Registers or updates an autonomic playbook.

  • **Request Body**: Playbook JSON
  • **Response**: { "status": "ok", "playbook_id": "..." }
  • GET /autonomic/policies

    Lists active autonomic trigger policies.

  • **Response**: Vec<AutonomicPolicy>
  • POST /autonomic/policies

    Registers a new autonomic trigger policy.

  • **Request Body**: AutonomicPolicy JSON
  • **Response**: { "status": "ok", "policy_id": "..." }
  • POST /autonomic/playbooks/:id/run

    Manually triggers execution of an autonomic playbook.

  • **Response**: { "status": "ok", "run_id": "..." }
  • GET /autonomic/runs

    Lists all active and historical playbook execution runs.

  • **Response**: Vec<PlaybookRun>
  • GET /autonomic/audit

    Audits the health, triggers, and execution rates of autonomic playbooks.

  • **Response**: PlaybookAuditReport
  • ---

    7. Civilization Kernel (SCK)

    GET /civilization/state & POST /civilization/state

    Returns the current 12-dimensional civilization state tensor and epoch.

  • **Response**: CivilizationState
  • POST /civilization/decision

    Evaluates a proposed civilizational delta and returns an autonomic steering decision.

  • **Request Body**: CivilizationDelta
  • **Response**: CivilizationDecision
  • POST /civilization/execute

    Atomically commits an approved civilization delta into systemic state.

  • **Request Body**: CivilizationDelta
  • **Response**: { "status": "ok", "receipt": CivilizationExecutionReceipt }
  • GET /civilization/audit

    Returns systemic vitality slope ($S_v$), tensor norm, and alignment audits.

  • **Response**: JSON
  • ---

    8. Live Documentation & Sync (ops/live_docs)

    GET /docs

    Interactive HTML browser interface for the Sovereign OS Wiki.

    GET /docs/page/:slug

    Renders an individual markdown documentation page by its slug (e.g. architecture, subsystems, api-reference).

    GET /docs/api

    Returns the entire machine-readable JSON AST of all routes, commands, and wiki pages.

    GET /docs/audit

    Bi-directional contract drift verification report comparing code contracts against documentation specifications.

    POST /docs/sync

    Triggers an immediate bi-directional live synchronization between code, markdown files, and cluster CRDs.

    ---

    C.A.T. PRO 5.0 Trading Engine Endpoints (cat.predator.run & os.predator.run)

    GET /cat

    Serves the flagship **C.A.T. PRO 5.0 Sovereign OS Native Application** cybernetic cockpit.

    GET /api/cat/health

    Health probe for C.A.T. PRO 5.0 native application returning application health, version, and sentinel status.

    GET /api/cat/status

    Returns real-time C.A.T. PRO 5.0 telemetry, portfolio NAV ($397.37), deployable cash ($60.53), inventory, spot prices, Rule 25 gates, Knapsack allocations, and active pools.

    GET /api/cat/pools

    Returns the complete list of 6 configured liquidity pools, fee tiers, and dip thresholds across Base Mainnet and Arbitrum One.

    GET /api/cat/knapsack

    Returns Dynamic Knapsack working capital allocations scaled across 3 operational tranches based on historical win rates.

    GET /api/cat/rule25

    Returns Rule 25 SSOT Never-Sell-At-A-Loss cost bases (cbBTC $85,820, WETH $2,650, AERO $0.8200) and active protective hold verdicts.

    POST /api/cat/rebalance

    Triggers immediate Knapsack capital rebalancing across deployable USDC.

    GET /api/cat/metrics

    Returns institutional Sharpe ratio, win rate, total cycles completed, and gas/friction savings.

    GET /api/cat/orders

    Returns the recent execution history and open orders from the Valkey persistent ledger.

    GET /api/cat/export

    Exports the complete transaction history in CSV or JSON format for institutional auditing.

    GET /api/cat/live_executions

    Returns recent executed on-chain trades from the Valkey sorted set timeline with double-buffered isolation and zero race conditions.

    GET /api/cat/active_trades

    Returns active Knapsack working capital tranches, entry/exit levels, and live open positions.

    GET /api/cat/stream

    Server-Sent Events (SSE) pipe streaming live trade events directly to web UI and dashboards.

    ---

    Sovereign Directives Operations Engine (os.predator.run)

    GET /api/directives

    Returns the list of all active, queued, and completed Sovereign Directives with 5DHCP ticket IDs, context cube vectors, saevcodes, action plans, and execution outputs.

    POST /api/directives/submit

    Dispatches an operational directive into the sovereign ecosystem. Automatically generates an authoritative 5DHCP ticket, assigns Context Cube coordinates, decomposes actionable steps, executes immediate kernel invariants, or queues for autonomous agent execution.

    GET /api/directives/:id

    Returns detailed inspection and real-time execution status for a single directive by ID or 5DHCP ticket hash.

    POST /api/directives/:id/update

    Allows autonomous agents (e.g. Antigravity Swarm) or cluster daemons to update directive execution status (IN_PROGRESS, COMPLETED) and append real-time execution logs.

    GET /api/directives/:id/logs

    Returns real-time execution logs, current lifecycle status, and timestamps for the specified directive or 5DHCP ticket.