curl -X POST https://api.sbs/api/sbs/signup \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com"}'curl -X POST https://api.sbs/api/sbs/v3 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"action": "ingest", "text": "Distributed consensus via Raft"}'curl -X POST https://api.sbs/api/sbs/v3 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"action": "multi_search", "query": "fault tolerance"}'All API calls require a Bearer token in the Authorization header:
Authorization: Bearer YOUR_API_KEYGet a free API key at api.sbs/signup. Free tier includes 10,000 credits. L0 encoding is always free.
https://api.sbs/api/sbs/v3All endpoints use POST with a JSON body containing an action field.
Health check — returns vault item count and service status.
{ "action": "status" }{ "service": "SBS v3", "items": 169, "levels": 5 }Encode text into the spectral vault. Returns L0 binary and queues L1-L4 agents.
{ "action": "ingest", "text": "Your content here", "sessionId": "optional-session-id" }{ "binary": "11000010011101011101000110001110", "credits_remaining": 9999 }Search the vault for spectrally similar items. Weighted across L0-L4.
{ "action": "multi_search", "query": "distributed consensus", "topK": 5 }{ "results": [{ "text": "...", "distance": 0.12, "level": 3 }], "credits_remaining": 9998 }Head-to-head spectral comparison of two texts.
{ "action": "compare", "textA": "First text", "textB": "Second text" }{ "hammingDistance": 8, "similarity": 0.75, "credits_remaining": 9997 }Deep auto-surface: finds contextually relevant items across all encoding levels.
{ "action": "surface", "query": "legal indemnity clause", "topK": 10 }{ "surfaced": [{ "text": "...", "score": 0.94 }], "credits_remaining": 9993 }Deductive OWL lookup — queries Wikidata, ConceptNet, DBpedia. Free.
{ "action": "owl_lookup", "query": "photosynthesis" }{ "wikidata": [...], "conceptnet": [...], "dbpedia": [...] }AI-powered guide response using vault context. Used by SpectralGuide UI.
{ "action": "guide_respond", "messages": [{"role":"user","text":"How does SBS work?"}], "context": {} }{ "response": "SBS uses DFT physics..." }| Level | Name | Method | Cost |
|---|---|---|---|
| L0 | Surface | ASCII DFT — deterministic | Free |
| L1 | Semantic | OWL IS/NOT decomposition | 1 AI call |
| L2 | Contextual | Differential vs session | 1 AI call |
| L3 | Fold | Kuramoto attractor clustering | 1 AI call |
| L4 | Portfolio | Cross-fold crystallisation | 1 AI call |
npm install @sbs/sdkimport { SBS } from '@sbs/sdk'
const sbs = new SBS({ apiKey: 'YOUR_API_KEY' })
// Encode
const result = await sbs.encode('Distributed consensus via Raft')
console.log(result.binary) // "11001010..."
// Search
const matches = await sbs.search('fault tolerance', { topK: 5 })
// Compare
const diff = await sbs.compare('text A', 'text B')
console.log(diff.similarity) // 0.75SDK source available at packages/sbs-sdk/ in the repo. npm publish coming soon.
| Action | Credits | Notes |
|---|---|---|
| status | 0 | Always free |
| ingest | 1 | L0 instant, L1-L4 queued |
| search / multi_search | 1 | Weighted across levels |
| compare | 1 | Head-to-head |
| surface | 4 | Deep cross-level scan |
| owl_lookup | 0 | Deductive, runs on Vercel |
| guide_respond | 0 | AI guide (SpectralGuide) |
Developer / User
│
▼
┌─────────────────┐
│ api.sbs (Vercel) │ Auth, credits, landing, SpectralGuide UI
│ Next.js │ SDK target: POST /api/sbs/v3
└────────┬────────┘
│ HTTP relay
▼
┌─────────────────┐
│ sbs-vault (Fly) │ Float64 tensor + 12 encoding agents
│ Node.js │ L0-L4 pipeline, OWL cascade, queue
│ Port 8080 │ Persistent volume /data
└────────┬────────┘
│ HTTP client
▼
┌─────────────────┐
│ sbs-brain (Fly) │ AI orchestrator (Z.ai MCP tools)
│ Python/FastAPI │ Batch ops, benchmarking, auto-seeding
│ Port 8000 │
└─────────────────┘API.SBS — Spectral Binary Search