Proprioceptive AI — Swarm API Reference (edge v1.8.8c)

Base URL: https://api.proprioceptiveai.com/v1/swarm. All requests and responses are JSON. Authentication: header X-API-Key: *** from signup. Free, no key: GET /health, GET /models, GET /verify/<receipt>, GET /capture/<family>. Trial defaults: 5,000 lifetime requests, 140/day, 336-hour (14-day) window. See Trial & limits.

Quickstart — three calls to a certified, publicly-verifiable verdict

Verified working end-to-end on 2026-11-25 against edge v1.8.8c (copy-paste top to bottom):

# 1. Sign up — the key is returned exactly once; store it now
curl -sS -X POST https://api.proprioceptiveai.com/v1/swarm/signup \
     -H 'Content-Type: application/json' \
     -d '{"email":"you@example.com"}'

# 2. Put the key from step 1's api_key field into your shell
export KEY="<your api_key from step 1>"

# 3. First verdict — one deliberation round (k=1, 3 votes, ~6 s)
curl -sS -X POST https://api.proprioceptiveai.com/v1/swarm/answer \
     -H "X-API-Key: ***" -H 'Content-Type: application/json' \
     -d '{"question":"Which planet is closest to the Sun?",
          "choices":["Venus","Mercury","Mars"],"k":1}' \
  | tee /tmp/verdict.json
# → {"selected":"Mercury","confidence_flag":"OK","evidence":"full",
#    "receipt":"<64-hex>", …}

# 4. Verify the receipt — anyone, no key, chain walked from genesis
curl -sS https://api.proprioceptiveai.com/v1/swarm/verify/$(jq -r .receipt /tmp/verdict.json | cut -c1-16)
# → {"chain_verified":true,"chain_position":N,"receipt_sha":"<64-hex>","ts":…}

Your signup response also embeds this quickstart with your real key pre-filled (the quickstart array) — running those lines verbatim gets you to a verdict too; step 3 there just needs the verify line's placeholder replaced with the receipt from the answer.

Receipts, ledger and offline verification

Every delivered response carries a receipt id and lands in an append-only hash-chained ledger. chain_rule: sha = sha256(prev_sha + canonical_json(event)) over all events, ordered by position; canonical_json is json.dumps(..., sort_keys=True) of the event minus its proof fields (sha, prev, prev_sha, index, event_type). /answer returns the full 64-hex receipt; /hook, /select and fleet events return the first 16 hex chars. The chain head (a 64-hex sha) is published in the export bundle (head_sha + head_index) and observable through /verify (chain_position).

A receipt proves inclusion in a tamper-evident history, not truth. Verdicts carry evidence: full | partial | low_vote_coverage — read it, don't assume. See Verifying your receipts.

Signup — POST /signup

Request body: {"email": "you@example.com"}. Response: 201 with api_key (the only time it is ever returned), client_id (cli_…), tier, daily_limit (140), total_cap (5,000 lifetime trial requests), trial_hours (336), expires (unix ts) + expires_human (UTC), base_url, docs_url, usage, a per-account quickstart (your key pre-filled), and hook_hint. Errors: 400 missing/invalid email (empty or >254 chars) or invalid JSON (json required); 200 with a note if the email already exists — key rotation is operator-handled; there is no self-service re-issue. If you lose a key, email logan@proprioceptiveai.com from the account email.

Certified selection — POST /select

Reads the answer from your submitted text (index or exact string) and returns the selected answer_index, answer, confidence_flag (OK or FLAGGED), evidence, receipt, quota fields (quota_used_today, quota_limit, trial_total_cap, trial_expires). Request: question (string, 5–2000 chars), choices (2–12 strings, ≤300 chars each), answer (index int or exact string; case is normalized: " mars " matches "Mars"; non-strings are rejected). Errors: 400 bad shape (question must be 5-2000 chars, choices must be 2-12 strings <=300 chars, answer must be an int index or a string); 404 answer index out of range (non-boolean int only); 403 unknown key; 401 missing key.

Hook — POST /hook (certified state gate)

Request: model_family (string, 1–64 chars), state (list of exactly 16 finite numbers). Response: hook_verdict (proceed | abstain | repair), model, evidence: verdict-only, margin, receipt (16-hex), quota fields.

Before your first /hook call — read this. The 16 numbers must come from our probe-capture protocol run against your model, and the capture shape for every certified family is public: GET /v1/swarm/capture/<family> (see Capture manifest below). Be precise about what that manifest enables today: it publishes the capture shape — template rule, pooling rule, layer indices, expected dimension, panel size and panel item ids — and it is shape information only; a complete self-serve capture (panel probe content, the reduction to the 16-vector, worked examples) and self-serve registration for new families are coming. Email logan@proprioceptiveai.com remains the lane for hands-on capture help and a worked example against your model. A state vector you invent is detected, not judged: a placeholder or synthetic ramp returns abstain with reason low_signal — never a capability signal — and the call still consumes quota. Until you have captured a real state vector, /select and /answer are the right entry points.

model_family accepts both public model ids from GET /models and the internal hook_families slugs — both resolve (e.g. phi-2 and phi2 → the same head; Qwen2.5-1.5B and qwen15b → the same head). Wrong family → 400 with valid_families (the 8 live slugs) and quota_refunded: true. Bad state → 400 state must be exactly 16 floats / state must be numeric.

Capture manifest — GET /capture/<family>

No key. For any certified family — public model id or hook_families slug, e.g. phi-2 or phi2 both resolve — returns the per-family capture manifest: model_family (canonical slug), template (chat-template rule for rendering the panel probes), pooling, capture_layers (layer indices to read), expected_dim (panel dimension), panel_size, and panel_item_ids (opaque cap-… probe ids). Unknown family → 404 edge envelope pointing at hook_families on GET /models. What the manifest gives you today: the capture shape — layers, template, pooling, dimension, panel size and ids. What it does not give you yet: the probe text behind the cap-… ids and the reduction from expected_dim to the 16 floats /hook accepts. Self-serve capture registration (new families included) is coming; until then, email logan@proprioceptiveai.com for hands-on help.

Answer — POST /answer (k-round deliberation)

Request: question, choices (same shape rules), optional k (1–8, default 5), n_shuffle (1–3, default 3), model (see GET /models). Response: selected_index (or null on abstain), selected (answer text or null), agreement (0.0–1.0), confidence_flag, abstentions, k, n_shuffle, model, evidence, votes_planned / attempted / completed / delivered (and votes_requested when a shuffle cap truncates the plan), votes_withheld, backend_failures, latency_ms, quota fields, and receipt (full 64-hex). Latency: k=5 (default) runs up to 15 backend votes and takes roughly 90–120 s. For a fast first call pass k:1 (~6 s, 3 votes). k outside 1–8 or negative n_shuffle → 400.

Batch — POST /batch (up to 25 items, one auth)

Request: {"items": [ {select-or-hook shape}, … ], "model": optional}; 1–25 items. Response: {count, results: [ … one full per-route response per item, in order … ], batch_receipt, receipts}. Each item consumes quota only on delivery — a failed item is not charged; every delivered row keeps its own receipt, the batch gets its own batch_receipt. Shape errors → 400 (items missing, >25, empty question, <2 choices, invalid k).

Control — POST /control (gated consensus over client-supplied votes)

Request: question, choices, votes (1–256 items of {client_ref: string ≤64, answer_index: int, weight?: number 0.0–10.0, confidence?: "OK"|"FLAGGED"}). Response: consensus (answer_index, answer, agreement, confidence_flag, total_weight, votes_in), dissent (list of non-consensus votes with refs and weights), override_signals (low_agreement, weight_concentration, confidence_mismatch, any_flagged), receipt, quota fields. flagged = at least one override fired; the gate fails CLOSED. Weights/refs validated → 400 on bad shapes.

Export — GET /export (owner receipt bundle)

Owner-scoped (or ?client_id= for admin keys) bundle of your chain events: ?since=&until= epoch-seconds filter; returns JSON (schema: lens-receipt-bundle-v1) with events (each with sha, prev_sha, index, event_type and its payload fields), count, head_sha, head_index, truncated, and the exact chain_rule string. Free on trial — no quota consumed. Note: the bundle is recomputable with the published chain_rule; a packaged offline verifier ships with the explorer (publication pending). Until then, GET /verify/<receipt> walks the chain for any receipt, key or no key — see Verifying your receipts.

Proof — GET /proof/<receipt> (owner-only)

Inclusion proof for receipts belonging to your account: position, prev/head anchors, record fields. Requires the owning X-API-Key; other tenants' and unknown receipts are indistinguishable (404) — no oracle.

Verify — GET /verify/<receipt> (public)

Chain verification for any prefix ≥8 hex: chain_verified, chain_position, receipt_sha, ts. A broken link reports chain_verified: false with a BROKEN_AT/UNPARSEABLE_AT position — never silence. Strangers get integrity only (event: null plus a note); owners presenting the owning X-API-Key also get the full event payload. Malformed/short prefix → 400 receipt prefix must be >= 8 chars; unknown → 404 receipt not found.

Health — GET /health

No key. Returns product, v (edge version — the live value is authoritative; 1.8.8e at last docs refresh 2026-11-26), backend_up, backend_resident, daily_limit, email_capture + email_capture_status, and the live clients / receipts totals. Note: receipts is the chain head index — it counts every chain event (verdicts, signups, fleet register/remove), not only delivered verdicts.

Models — GET /models

No key. models dict (id → class serving | cert-only | pending-cert, serving, engine, note, features: consensus, entropy_flag, twin_audit, select/graft_select where applicable, and hook — true when a certified hook head is live for that family) plus top-level hook_families: the 8 slugs /hook currently answers for (phi2, qwen15b, hermes3chat, zephyrchat, olmoe-1b-7b, smollm3-3b, qwen15-moe-a2p7b, yi-6b). Read hook: true (or the slug list) as the authority on what you may call; model-id/alias resolution is described under Hook.

Status — GET /status

Your account: client_id, tier, used_today, limit (daily), used_total (lifetime), total_cap (5,000), expires, created. 401 unknown key on a bad key.

Swarm control plane (agents)

Register up to 500 agents per account; gate each one's state through the same certified readers as /hook; judge fleet convergence over your own roster.

Owner-isolated. Agents belong to one account. Another tenant's agent_id is indistinguishable from a missing one (same 404) — the fleet API is not an existence oracle. Kill switch: operator-controlled and receipted per client. One quota spine: register/remove/list are free; gate and judge consume exactly like single requests; zero-delivery calls are refunded. Everything on the chain: register, gate, remove and judge events land in the same hash-chained ledger your export bundles.

Trial & limits

Verifying your receipts

Every number below is what our own QA account got on 2026-11-25; substitute your receipt.

# 1) Any receipt (or just its first 8+ hex chars), anonymously, from the public chain:
curl -sS https://api.proprioceptiveai.com/v1/swarm/verify/c416fcbf
# → {"chain_verified": true, "chain_position": 3331, "receipt_sha": "c416fcbf…",
#    "event": null, "ts": 1795587349,
#    "note": "payload owner-only; present owning account X-API-Key"}

# 2) With the OWNING account's key you also get the recorded event (what was answered):
curl -sS -H "X-API-Key: ***" \
     https://api.proprioceptiveai.com/v1/swarm/verify/c416fcbf
# → {"ts":…, "client_id":…, "model":…, "q_sha":…, "k":…, "sel":…, "agr":…,
#    "abst":…, "ms":…, "sha": "c416fcbf…", "prev": "8b4992c6956a5510",
#    "chain_verified": true, "chain_position": 3331}

# 3) Export your whole slice and recompute every link yourself (rule is published):
curl -sS -H "X-API-Key: ***" \
     'https://api.proprioceptiveai.com/v1/swarm/export?since=1795500000' \
  | jq '{count, head_sha, head_index, chain_rule}'

What a true means: chain_verified = every link from genesis to your event's position recomputes. What it does not mean: that the answer is true. If a verify ever returns false with BROKEN_AT, stop and tell us — that is the one event our whole design says must never happen.

Shared error envelope

{"error": "human-readable message"} with status 400 (malformed input), 401 (missing/unknown key on GET routes), 403 (unknown key / cap / expiry on POST routes), 404 (unknown resource), 409 (agent cap), 429 (quota). Every error message names the broken field and the valid shape/range, and carries quota_refunded: true when a billable call returned undelivered. (Known inconsistency being unified edge-side: unknown-key is currently 403 on /answer-family POSTs and 401 on /status.) Note: paths that don't exist at all under /v1/swarm/ may be answered by the upstream proxy's {"detail": "Not Found"} envelope instead of the edge envelope — treat error as the contract; edge-owned 404s are in validation.

What this API never returns

Raw model outputs, logprobs, token-level internals, or the sensor internals behind confidence_flag/verdicts. The ledger stores the question hash (q_sha, first 16 hex of SHA-256), never the question text.