N8N UNIVERSAL API
Universal Flow API Contract¶
This document captures the minimal API surface needed by an external orchestrator (e.g., n8n) to drive Mobius OS flows without elevated privileges.
/v1/deliberate¶
- Method:
POST - Auth: Broker API key header
- Body:
{
"prompt": "string",
"routingMode": "local | antigravity-first | antigravity-only | multi-engine",
"engines": ["antigravity", "openai", "claude", "deepseek"],
"allowedTools": ["web-search"],
"safetyLevel": "low | medium | high",
"metadata": { "campaign": "string" }
}
- Success Response:
{
"status": "ok | needs_human_review",
"gi_score": 0.97,
"decision": "ok | needs_human_review | human_required | reject",
"answer": "final decision text",
"deliberation_id": "uuid",
"engines": [
{
"engineId": "antigravity",
"answer": "string",
"riskFlags": [],
"latencyMs": 1234
}
],
"flags": [],
"consensus_source": "remote | local"
}
- Human review Response: HTTP
202with the same payload butstatus = "needs_human_review".
Civic Ledger Snapshot¶
- Endpoint:
GET {LEDGER_BASE_URL}/ledger/stats/mii - Returns:
{ "mii": number, "trend": "up" | "down" | "flat", "window": "PT1H" } - Used by orchestrators to annotate outbound messages with the current GI trend.
DVA.LITE¶
GET /health— readiness plus broker metrics; useful for dashboards.GET /metrics— Prometheus text for Grafana or Render monitors.POST /alerts/check— triggers a webhook alert whenMII < 0.95.
Guardrails Checklist¶
- Always log
deliberation_idalongside downstream postings. - Treat
needs_human_reviewandhuman_requiredas non-final until an operator confirms. - Surface GI trend + ledger attestation links wherever results are displayed.
- Never store or replay raw engine outputs; rely on the Broker response for provenance.