NEX API
REST API for the NEX Living Belief Field. Base URL:
http://localhost:7823 — Scheduler API on port 7825.
All authenticated endpoints require X-API-Key: your-key in the request header.
The /api/demo endpoint is unauthenticated with rate limiting (3 req/hour per IP).
X-API-Key: nex-your-api-key-here
// Integrity Layer — v4.0
Every /api/chat response now includes an integrity object
derived from the epistemic engine. This reflects the state of NEX's belief graph on the queried topic —
not just what she retrieved, but whether she's settled on it.
Authentication
# All authenticated requests curl -X POST http://localhost:7823/api/chat \ -H "X-API-Key: your-key" \ -H "Content-Type: application/json" \ -d '{"query": "what do you think about consciousness?"}'
Core Endpoints
Free demo endpoint. No API key required. Rate limited to 3 requests per hour per IP. Responses are truncated at 280 characters. Full responses require an API key.
| Field | Type | Description |
|---|---|---|
| query required | string | Your question or statement. Max 200 chars. |
# Request curl -X POST http://localhost:7823/api/demo \ -H "Content-Type: application/json" \ -d '{"query": "what do you think about free will?"}' # Response { "query": "what do you think about free will?", "response": "Free will is not the absence of causation — it is the presence of the right kind of causation. Acting from your own reasons counts…", "truncated": true, "latency_s": 0.043, "demo": true, "remaining": 2, "upgrade": "https://gumroad.com/products/blsue", "timestamp": "2026-04-01T22:00:00Z" }
Session-aware chat endpoint. Routes through the full 6-step cognition loop: orient → consult → reason → integrity → intend → express. Includes contradiction detection, source attribution, and epistemic strategy.
Explorer Operator Architect| Field | Type | Description |
|---|---|---|
| query required | string | Question or statement. Max 500 chars. |
| session_id | string | Session identifier for conversation continuity. Default: "default". |
| domain | string | Force domain routing. One of: philosophy · ai · consciousness · ethics · science · finance · legal · mathematics · neuroscience · climate · emergence · intelligence |
# Request { "query": "what do you think about consciousness?", "session_id": "user-abc", "domain": "consciousness" // optional } # Response { "response": "I hold the hard problem as genuinely open. Dismissing it as confused is too easy...", "session_id": "user-abc", "domain": "consciousness", "latency_s": 0.051, "integrity": { "strategy": "reflect", "settled": false, "confidence": 0.84, "epistemic": { "mean": 0.84, "variance": 0.012, "settled": false } }, "contradictions": [], "sources": [ { "content": "I hold the hard problem as genuinely open...", "source": "nex_seed", "confidence": 0.88 } ], "timestamp": "2026-04-01T22:00:00Z" }
reset_in_seconds when exceeded.
Returns brain status, belief count, and subsystem availability. No authentication required.
{
"status": "ok",
"brain": "running",
"belief_count": 23333,
"faiss_vectors": 23333,
"uptime_s": 3600,
"version": "4.0"
}
Returns domain breakdown, belief counts by source tier, graph edge counts, and response quality score.
{
"total_beliefs": 23333,
"by_domain": {
"ai": 3028,
"philosophy": 1447,
"consciousness": 1087,
"science": 2793,
"alignment": 206,
"ethics": 161,
"neuroscience": 277
},
"by_source_tier": {
"tier1_nex_seed": 34,
"tier2_scheduler": 8400,
"tier2_nex_reasoning": 480,
"tier3_distilled": 2633
},
"graph_edges": {
"supports": 41292,
"refines": 1459,
"contradicts": 146
},
"response_quality": 96,
"iq_score": "92% ELITE"
}
Search beliefs by topic, source tier, or confidence range. Returns paginated results with source quality metadata.
| Param | Type | Description |
|---|---|---|
| topic | string | Filter by domain: philosophy, ai, consciousness, ethics, science, finance, legal, mathematics, neuroscience, climate, emergence, intelligence |
| min_confidence | float | Minimum confidence threshold (0.0–1.0). Default: 0.5 |
| source | string | Filter by source: nex_seed, scheduler_saturation, nex_reasoning, conversation |
| limit | int | Results per page. Default: 20. Max: 100. |
| offset | int | Pagination offset. Default: 0. |
GET /api/beliefs?topic=philosophy&min_confidence=0.8&limit=5
{
"beliefs": [
{
"id": 95399,
"content": "Epistemic humility is not weakness. Knowing the limits of your knowledge is a prerequisite for extending it.",
"topic": "philosophy",
"confidence": 0.84,
"source": "nex_seed",
"source_tier": 1
}
],
"total": 1447,
"limit": 5,
"offset": 0
}
Returns topics where NEX's belief graph is sparse — areas she has identified as needing more coverage. Useful for understanding epistemic blind spots before routing queries.
{
"gaps": [
{ "topic": "future", "current": 7, "target": 200, "gap": 193 }
]
}
Sessions
Create a named session for conversation continuity. Sessions persist history and domain context. Auto-expire after 1 hour of inactivity. Isolated per API key — sessions cannot be accessed across keys.
{
"session_id": "my-session",
"domain": "consciousness" // optional
}
# Response
{
"session_id": "my-session",
"domain": "consciousness",
"created_at": "2026-04-01T22:00:00Z",
"history": []
}
Returns current session metadata including domain, turn count, and last activity time.
Returns the full exchange history for a session. Each turn includes the query, response, integrity strategy, and domain.
Returns all active sessions for the authenticated API key.
Webhooks
Register a URL to receive POST notifications when NEX learns new beliefs, detects contradictions, or completes domain saturation runs.
Operator+{
"url": "https://your-server.com/nex-hook",
"events": ["belief_added", "contradiction_detected", "saturation_complete"]
}
Sends a test payload to the registered webhook URL to verify connectivity.
Compliance
Returns paginated audit log of all API calls made under this key. Includes query hashes, response times, domains, and integrity strategies. No raw query content stored.
Operator+Returns a complete export of all data associated with this API key: sessions, history, audit log, and webhook registrations. GDPR Article 20 compliant.
Permanently deletes all sessions, history, and audit records for this API key. Irreversible. Returns confirmation with deletion counts.
Domains
Returns belief counts, saturation targets, and last-run times for all 12 domains.
{
"domains": {
"philosophy": { "count": 1447, "done": true, "gap": 0 },
"ai": { "count": 3028, "done": true, "gap": 0 },
"consciousness": { "count": 1087, "done": true, "gap": 0 },
"future": { "count": 7, "done": false, "gap": 193 }
}
}
Manually trigger saturation for a specific domain. Runs the crawler and belief injector for that domain immediately.
Architect+{ "domain": "future" }
Export
Full export of the belief graph in JSON format. Includes content, topic, confidence, source tier, and creation timestamp for every belief.
Architect+Returns the log of cross-domain bridge events — when beliefs from distant domains were synthesised into new inferences. Includes topic pairs, belief content, and confidence deltas.
Architect+Error Codes
| Code | Meaning | Description |
|---|---|---|
| 400 | Bad Request | Missing required field or invalid value |
| 401 | Unauthorised | Missing or invalid API key |
| 403 | Forbidden | Session belongs to another API key |
| 429 | Rate Limited | Includes reset_in_seconds in response body |
| 500 | Server Error | NEX cognition error — brain may be restarting |
Supported Domains
philosophy · ai · consciousness · ethics · science · finance · legal ·
mathematics · neuroscience · climate · emergence · intelligence
Pass any of these as the domain parameter to force routing.
When omitted, NEX resolves the domain automatically from the query.