Study guide

Learn TokenOne® end to end.

One long page covering every function, screen, report and admin surface in the platform. Sticky table of contents on the left; Ctrl-F finds anything. Designed to be read in order on the first pass and used as a reference forever after.

Section 1

TokenOne in one screen.

TokenOne is the AI utility and middleware layer for productivity. It sits above models and compute, and below the tools your team already uses. One wallet, governed delivery, quality protected, burn reduced — and a chain-verified ledger of every token.

The one-line story

Every AI call coming through TokenOne gets read, planned, delivered, verified, optionally escalated, and fed back. The wallet debits in real time, the ledger seals the entry, and the savings against your chosen benchmark provider are computed on every row.

You configure TokenOne once (wallet top-up, benchmark provider, project budgets, integration tier), then your team keeps working in the tools they already use. TokenOne handles the policy, the redundancy and the accounting.

The three questions every TokenOne user has

  1. How much have I spent and how much have I saved? — see /overview + section 8.
  2. Which calls did TokenOne actually make on my behalf, and why? — see /analytics + /settings/ledger.
  3. How do I plug TokenOne into the tool my team is already in? — see section 5 — connectors.

Locked vocabulary (used everywhere in the product)

These five phrases appear on every customer-facing surface. The wording is intentionally fixed so the savings story stays consistent across screens.

Tokens saved
absolute count
Tokens TokenOne governed delivery preserved vs the benchmark provider.
% saved
ratio
Tokens saved as a share of benchmark-equivalent burn.
Benchmark provider
brand
The provider you selected as the comparison anchor (OpenAI, Anthropic, Google, xAI, Meta).
TokenOne burn
tokens
Real tokens consumed via TokenOne governed delivery. (Replaces "Actual burn", retired 2026-05-27.)
<Provider>-equivalent burn
tokens
What the same workload would have cost at the benchmark provider's pricing. Renders as "Anthropic-equivalent burn", "OpenAI-equivalent burn", etc.; falls back to "Benchmark-equivalent burn" when no provider is selected. (Replaces "Baseline-equivalent burn", retired 2026-05-27.)

Section 2

The five pillars.

Every feature in TokenOne maps to one of these five pillars. Read them in order if you're new — the dependencies run top to bottom.

Pillar 1 — Token Wallet

One balance per tenant. Tops up via Stripe (test mode in dev). Every AI call debits BigInt-precise token counts; the ledger seals each debit and the wallet balance is the running source of truth.

balance
BigInt
Spendable tokens, integer (BigInt because token counts cross JavaScript's safe-integer ceiling fast).
reserved
BigInt
Tokens earmarked for in-flight calls. Released on completion or failure.
debited
BigInt
Tokens already spent in this window (24h / 7d / 30d depending on screen).
runway
days
balance ÷ rolling daily burn. Shown on /overview as "X days at current pace."
auto-topup
rule
Optional. When balance < threshold, charge the saved card for the configured amount.

Top-up flow: /billing → Add tokens → Stripe checkout → webhook → wallet credit → ledger entry. The ledger entry is the audit row; the wallet row is the running balance.

Pillar 2 — SmartOne Routing

Three layers run on every call. Layer 1 picks the model class (deterministic, <5ms p99). Layer 2 picks the compute endpoint (provider health, region, residency, failover). Layer 3 is the QA feedback loop, scoring responses and feeding suppression / escalation rules back into layers 1+2.

task family
classification
coding / writing / research / data-analysis / etc. Drives which model class wins.
complexity
low | medium | high
Heuristic on prompt + context. Higher complexity climbs the quality ladder.
quality floor
rubric score
The minimum acceptable QA score. Below this, the call escalates.
approved delivery path
path
The model + compute endpoint actually used. Logged on every llm_call_logs row.
escalation
event
When QA fails, TokenOne retries up the ladder. The user receives the better answer; the failed attempt is in the ledger.
The customer never picks a model. The customer picks the brand they want to use as the benchmark. SmartOne picks the model class on every call based on task family + complexity + your chosen quality floor.

Pillar 3 — AI Connectors (six tiers)

The six ways TokenOne plugs into AI workflows. All six route through SmartOne; the difference is only the shape of the integration. Full table in section 5.

  1. Proxy — drop-in OpenAI / Anthropic / Google-compatible endpoints. One env var change.
  2. MCP server — Claude Desktop and any MCP-aware client.
  3. Browser extension — for clients that can't be proxied.
  4. Desktop bridge — local app on the user's machine.
  5. Copy-paste — manual fallback.
  6. Advisory — read-only "what would TokenOne do" mode.

Pillar 4 — Chain-verified Ledger

Every wallet event becomes a ledger entry. Entries are HMAC-SHA256 chained: each row's seal hash includes the previous row's. The chain is verifiable end-to-end with GET /api/tenant/ledger/verify. Customer-facing event types are mapped to plain-English labels ("Top-up", "AI usage", "Refund", etc.) — internal type codes stay in the admin view.

seal hash
hex
HMAC-SHA256(prev_hash + entry_payload, LEDGER_HMAC_KEY).
prev hash
hex
The previous entry's seal hash. The chain unravels if any row is altered.
event type
enum
Internal: WALLET_TOPUP, AI_USAGE, REFUND, ADJUSTMENT. Customer view: plain labels.
amount micros
BigInt
Tokens debited or credited, signed.
project id
UUID
Which project the entry attributes to. Lets /analytics group spend per project.

Pillar 5 — QA + Continuous Improvement

A read-replica analysis loop scores every response asynchronously. Scores feed back into routing (suppression / escalation), into the benchmark math (was the delivered answer actually as good as the baseline-equivalent would have been), and — when promoted — into the offline learning plane.

accuracy
0..1
How factually correct the response is against the prompt's intent.
structure
0..1
Did the response respect the requested format (JSON, markdown, etc.)?
hallucination risk
0..1
Higher = more likely to fabricate. Triggers escalation above threshold.
instruction fidelity
0..1
Did the model follow the system prompt + user instructions?
QA runs asynchronously and never blocks the user's call. The score is written to the ledger entry after the fact, then read by the next call's router.

Section 3

Every customer screen, explained.

Each sub-section here matches a route in the tenant web app. The route is the heading; under it, every visible widget and field is named and described.

/overview — Executive health

The first screen after login. Five hero tiles + a savings chart + a live activity feed. Designed so an executive can read the project's health in under 10 seconds.

Wallet balance
Current balance in tokens + USD-equivalent. Click → /billing.
Tokens saved (30d)
Absolute tokens preserved vs the benchmark provider in the last 30 days.
% saved (30d)
Same number as a share of benchmark-equivalent burn. The headline KPI.
TokenOne burn · 30d
Real tokens consumed via TokenOne governed delivery in the last 30 days.
Runway
Days remaining at current rolling burn rate.
Savings chart
Daily line: TokenOne burn vs <Provider>-equivalent burn over the window. Toggleable 7d / 30d / 90d.
Live activity feed
Last 50 events: AI usage, top-ups, escalations, threshold alerts. Click any row → /analytics filtered to that ID.
The chart shows "Set your benchmark provider" if tenants.baseline_provider_keyis null. Never a fake 0% comparison. Set it in /billing.

/analytics — Deep dive

Drill-downs grouped into Usage / Savings / Ledger / Audit. Each tab queries the insights-engine — the read-only aggregator that powers every chart and table on customer-facing surfaces.

Usage tab
Token in/out per task family, per project, per hour. Compare two date ranges.
Savings tab
Per-day actual vs baseline-equivalent. Hover any point → drill to the calls in that bucket.
Ledger tab
Filterable list of every ledger entry. Running balance column on the right.
Audit tab
Decision summaries: why TokenOne picked the path it did on each call, evidence trail, change log, export log.
Search filter
Free-text filter on activity rows — matches against prompt fragments, project name, model id.
Engine versions
Each chart footer lists the insights-engine version that produced it. Versions bump on every locked-wording change.

/summary — Daily / weekly digest

A printable, screenshot-friendly recap. Auto-emailed to the wallet owner on the configured cadence. Same KPIs as /overview but with period-over-period deltas and one sentence of human-readable commentary per row.

Period selector
Today / Yesterday / WTD / MTD / Custom. Defaults to the cadence set in /notifications.
Delta
Numeric change vs previous comparable period. Green if direction is positive for the metric, red otherwise.
Top movers
The three metrics with the largest absolute movement in the window.

/account — Profile + preferences

Personal settings, not tenant settings. Powered by the users table (the columns shipped 2026-05-26: timezone, bio, avatar_url, email_verified_at).

Name
Display name. Surfaced on email + activity feed.
Email
Login + recovery email. Verifying it sets email_verified_at.
Timezone
Used for /summary delivery time + activity-feed timestamps.
Bio
Optional free text. Visible to other tenant users in /security → team.
Avatar URL
Optional. Rendered in the header chip.

/billing — Wallet top-up + benchmark

Where you fund the wallet and choose the benchmark provider. Stripe lives here.

Add tokens
Stripe checkout. Increments balance and writes a WALLET_TOPUP ledger entry.
Auto-topup
Threshold + amount. Fires the same Stripe flow programmatically.
Benchmark provider picker
OpenAI / Anthropic / Google / xAI / Meta. Sets tenants.baseline_provider_key; every new call gets a baseline-equivalent comparator computed against this brand's pricing.
Payment method
Card on file. Saved via Stripe; TokenOne never sees raw card data.
Invoices
Historical receipts. PDF download per top-up.
Changing the benchmark provider applies to NEW calls only. Historical rows keep the benchmark provider they were attributed to at the time of the call — the audit trail can't retroactively change.

/security — Sessions + tokens

Active sessions + API tokens + audit trail. The Active Sessions tab is where the idle-logout auto-sign-out dropdown lives (writes tokenone-session-idle-msto localStorage; the SessionManager reads it every 30s).

Active sessions
All devices + locations holding a valid refresh token. Revoke any with one click.
Auto sign-out
Idle threshold dropdown (15min / 1h / 4h / 24h / never). Changing it rewrites the localStorage key.
API tokens
Personal access tokens for CLI / scripts. Scoped per tenant.
Audit log
Login / logout / token-revoke events. Tamper-evident.

/notifications — Alerts + digest cadence

Two types of alerts: balance / runway thresholds and quality / escalation events. Configurable per channel (email / webhook).

Balance threshold
Trigger when wallet balance drops below N tokens.
Runway threshold
Trigger when runway drops below N days.
Escalation alert
Trigger when an in-flight call escalated above the quality floor.
Digest cadence
Daily / weekly. Drives /summary email delivery.
Webhook URL
Optional outbound URL for any of the above alerts. Signed payloads.

/integrations — Connector setup

The connector catalogue. Each tile is a tool (Claude Desktop, Cursor, VS Code, ChatGPT-compatible client, etc.) with a tier-specific setup wizard.

Tile
Tool name + tier + status (connected / disconnected / not configured).
Setup wizard
3-5 step flow per tile. Generates API keys, copies config snippets, validates the round trip.
Connection test
Sends a dummy prompt through the integration end-to-end. Surfaces failure mode if it doesn't round-trip.
Tier badge
Proxy / MCP / Browser / Desktop / Copy-paste / Advisory.

/developer-zone — API clients + tools + catalogue

The technical operator surface. Three sub-pages: Clients, Tools, Model Marketplace.

/developer-zone/clients
API keys per environment (dev / staging / production). Format: tp_dev_xxx / tp_live_xxx. Rotation with 24h overlap window.
/developer-zone/tools
Internal tool catalogue: shell, browser, etc., available to your project's AI agents.
/developer-zone/model-marketplace
Read-only catalogue of every model SmartOne can route to, with capability tags + per-token pricing per brand.

/smartone — Project workspaces

One workspace per project. Each workspace owns its own budget, its own quality floor, its own integrations list and its own activity stream — but inherits the tenant wallet.

Workspace switcher
Top-bar dropdown. Switching changes the project context for the entire app.
Project settings
Per-project budget + quality floor + benchmark override (rare; defaults to tenant).
Activity
Filter the global feed to this project only.

/settings/ledger — Ledger inspector

The complete ledger as a paginated table. Filterable by event type, date range, project, amount. Includes the verify button that calls GET /api/tenant/ledger/verify and reports any chain breaks.

Event type
Customer label (Top-up / AI usage / Refund / Adjustment). Hover to see internal type code.
Amount
Tokens debited or credited. Signed integer, BigInt-precise.
Running balance
Cumulative wallet balance as-of this row. Computed server-side; seeded from the first row.
Seal hash
First 8 chars of the row's HMAC seal. Full hash visible on row expand.
Verify chain button
Walks every row in the window, recomputes each seal, returns the first broken row id (or null).

Section 4

Admin · the Continuous Learning Plane.

The learning plane is the offline ML layer that observes platform traffic, mints proposals for new rules, and validates them through governed gates. It NEVER blocks live traffic. Phase 1 ends at proposal[minted]; Phase 2 takes a minted proposal through synthetic + replay + cost + gates without mutating runtime.

How the plane fits above the platform

The live plane (every customer call) emits an outbox event per dispatch. The learning plane consumes the outbox asynchronously and walks it through six stages: outbox → evidence → pattern → signal → proposal → validation. Only the validation stage writes to anything customer-visible — and even that stays in admin until governance approves a promotion.

The runtime rule: rules run live. ML teaches the rules offline.The learning plane never sits in the request hot path.

Evidence → Pattern → Signal → Proposal (Phase 1)

Phase 1 is the ingestion + signal-detection chain. Slice 1 ends at proposal[minted]. Every row is append-only; the plane reconstructs state from history, not from in-place edits.

LearningOutboxEvent
table
One row per dispatch. Fields: tenant, project, request, response, model id, token counts, quality score, latency, timestamp. The raw stream.
LearningEvidence
table
Aggregated, de-duplicated outbox events. Same shape but grouped by content hash so the same request pattern doesn't flood downstream stages.
LearningPattern
table
Rolled-up evidence by classifier features (task family, complexity, response shape). Patterns are what signals fire against.
LiveCoverageSnapshot
table
Per-tag coverage view: which task families have enough evidence for which signals to be statistically valid.
Live*Signal (6 tables)
tables
Six signal detectors (cost, quality, latency, drift, coverage, escalation) each write rows when they fire. A signal that fires N times in a window mints a proposal.
LearningProposal
table
The candidate-rule row. status starts at minted in Phase 1 and STAYS there through all of Phase 2.

Phase 2 — candidate validation

Phase 2 takes a minted proposal and proves whether it should ever be promoted — without mutating runtime. Six stages: synthetic generation → quality scoring → replay → Gate 1 (synthetic) → Gate 2 (replay) → cost attribution.

LearningSyntheticGenerationPolicy
table
The policy a synthetic batch is generated under. Tier A/B/C, max cases per batch, max cost, min quality threshold, generator template, optional model id.
LearningSyntheticBatch
table
One batch per (proposal, policy, evidence window). Status: generating → scored | rejected. Records actual cost.
LearningSyntheticCase
table
One row per generated case. Carries inputBlob, optional expectedBlob, tags, deterministic caseHash, and generationMethod (template / cheap_model / frontier / fixture).
LearningSyntheticQualityScore
table
1:1 with cases. Four dimensions: duplicationScore, noveltyScore, discriminativePower, coverageContribution. Plus accepted bool + rejectionReason.
LearningReplayRun
table
One run per (proposal, batch). Replays the accepted cases through the proposal's would-be rule and records pass/fail counts.
LearningReplayResult
table
One row per replayed case. Carries actualOutput, expectedOutput, passed bool, divergenceReason.
LearningProposalGateResult
table
Append-only gate evaluation history. gate_id is 'synthetic' (Gate 1) or 'replay' (Gate 2). Each evaluation writes a NEW row; the proposal's denorm pointer points to the latest.
LearningProposalValidationCost
table
Per-proposal cost tally. Refreshed from source on every Phase 2 step. Denormalised to proposal.validationCostMicros.
LearningPlaneBudgetWithdrawal
table
Append-only audit row per $-spending operation. Idempotency key prevents double debits.

Gate 1 (synthetic) + Gate 2 (replay)

The two gates are run by phase2-gate-evaluator.service.ts. They're separate rows, separate evaluations, with separate thresholds. A proposal can pass one and fail the other — that's a real outcome the operator needs to see.

Gate 1 — synthetic
Reads the latest LearningSyntheticBatch + quality scores. PASS if acceptedCount / caseCount ≥ policy.minQualityThreshold. Writes a LearningProposalGateResult with gate_id='synthetic'.
Gate 2 — replay
Reads the latest LearningReplayRun + results. PASS if passedCount / caseCount ≥ the configured replay threshold. Writes a LearningProposalGateResult with gate_id='replay'.
proposal.gate1ResultId
Denorm pointer to the most recent Gate 1 row.
proposal.gate2ResultId
Denorm pointer to the most recent Gate 2 row.
proposal.status
STAYS 'minted' throughout. Gate results live on LearningProposalGateResult, not on the proposal's status field.

Validation cost attribution

Every $-spending Phase 2 operation (Tier B generation, future Tier C) writes a row to LearningPlaneBudgetWithdrawal AND increments the budget'sspent_micros column. The validation-cost service then re-aggregates from source.

refreshValidationCost(proposalId)
Refresh-from-source. Idempotent: same totals on re-run. Sums withdrawals + synthetic batch costs + replay run costs scoped to this proposal.
totalValidationCostMicros
Sum of all costs incurred validating this proposal, in USD micros.
caseCountSynthetic
Number of synthetic cases that contributed to validation.
caseCountReplay
Number of replay-run cases that contributed.
runCount
Number of replay runs attempted for this proposal.
proposal.validationCostMicros
Denorm of totalValidationCostMicros. Updated after every refresh.
proposal.lastValidatedAt
Timestamp of the most recent refresh. Drives the "stale validation" flag in admin.

Tier A / B / C generators

Three synthetic generators, each with a different cost / quality / risk profile. The orchestrator dispatches based on policy.tier.

Tier A — template
Deterministic JSON-template permutation generator. FREE (cost = 0). Bounded by maxCasesPerBatch. The default for any policy that doesn't need open-ended generation.
Tier B — cheap-model
Calls a cheap upstream model (e.g. Moonshot Kimi 2.5) via OpenRouter to produce synthetic cases. Mock-mode default — opt in to live via LEARNING_TIER_B_LIVE=true + OPENROUTER_API_KEY. Budget hard-bounded by policy.maxCostPerBatchMicros; the orchestrator debits BEFORE the upstream call. Output flows through the SAME quality-score + replay pipeline as Tier A.
Tier C — frontier
Scaffolding only. Disabled in Phase 2. Four independent gates refuse it: (1) schema default enabled=false, (2) orchestrator approvedByUserId check, (3) orchestrator hard-throw on tier==='C', (4) the generator file itself throws unconditionally. Phase 3+ work; do not enable.
Cheap-model candidacy is non-live. No writes to smart_router_models,llm_call_logs, or any dispatch surface. The proof: a smoke section snapshots row counts before and after a full Tier B run and asserts zero delta.

Budget enforcer (the hard-stop)

One service guards every $-spending operation: budget-enforcer.service.ts. Uses Postgres SELECT FOR UPDATE to serialise debits across concurrent workers, idempotency keys to prevent retry duplication, and an append-only audit row (LearningPlaneBudgetWithdrawal) as the only evidence of spend.

debitBudget(input)
Returns {withdrawalId, freshDebit}. freshDebit=false means the idempotency key matched an existing row — no second debit happened.
BudgetExceededError
Thrown when budget.budgetMicros - budget.spentMicros < amountMicros. The operation never runs; no audit row written.
idempotencyKey
Caller-supplied string. Format: synthgen:synth:{proposalId}:{policyId}:{windowKey}. Same key = same withdrawal id.
ensureBudgetsForWindow()
Idempotent boot routine. Ensures one LearningPlaneBudget row exists per category per current month-window.

The eight Phase 2 locks (always enforced)

These eight constraints are asserted by every Phase 2 test, every smoke section, and the orchestrator code paths themselves. If any of them ever fails, treat it as a P0 incident.

  1. proposal.status stays 'minted' through every operation.
  2. No approve / no reject (no writes to approvedByUserId / rejectReason / approvedAt).
  3. No publish / no promote (no manifest write path).
  4. No manifest (proposal.manifestId stays null).
  5. No rollout / no rollback (not implemented in Phase 2).
  6. No runtime mutation (zero writes to smart_router_* / llm_call_logs / dispatch surfaces).
  7. No live cheap-model promotion (Tier B mock-mode default; live opt-in never wired to dispatch).
  8. Tier C disabled — four independent gates fire.

Section 5

The six connector tiers.

All six tiers route through SmartOne and write to the same ledger. The only thing that varies is the integration shape — i.e. how the request reaches TokenOne.

1

Tier 1Proxy

Anyone using an OpenAI / Anthropic / Google SDK.

Drop-in compatible endpoints. Replace the SDK base URL with the TokenOne proxy URL and your tp_dev / tp_live key — zero code change.

Watch for: The most invisible integration. If your tool can&apos;t change base URL, use Tier 3 (Browser) or Tier 4 (Desktop).

2

Tier 2MCP server

Claude Desktop and other MCP-aware clients.

Local stdio process speaking Model Context Protocol. Add it to claude_desktop_config.json; restart Claude; you&apos;re routed.

Watch for: Per-machine install. Auto-updates via the desktop bridge if it&apos;s also installed.

3

Tier 3Browser extension

Tools you can&apos;t proxy (web ChatGPT, web Claude, web Gemini).

Chrome / Edge extension. Intercepts the page&apos;s fetch calls, re-routes them through TokenOne, splices the response back into the UI.

Watch for: Works only on pages the user has authenticated against. Subject to upstream UI changes.

4

Tier 4Desktop bridge

Anyone who wants a local control surface + auto-update for the MCP server.

Native app (Electron). Runs the MCP server, exposes a tray icon, handles auth refresh, surfaces alerts.

Watch for: Optional but recommended if you&apos;re running MCP across multiple clients.

5

Tier 5Copy-paste

Anyone whose tool simply can&apos;t be integrated yet.

Paste your prompt into the TokenOne web app; it routes and returns the response; you paste it back into your tool.

Watch for: Manual. Useful as a last resort or for high-stakes single calls.

6

Tier 6Advisory

Teams not yet ready to switch.

Read-only. You send TokenOne your historical calls; it tells you what it WOULD have done and what you WOULD have saved. No live routing.

Watch for: Decision-support only. Often the first step before flipping a project to a live tier.

Section 6

API surfaces.

Every API surface TokenOne exposes. Customer-facing endpoints are first; admin / internal endpoints come after.

Proxy endpoints — drop-in OpenAI / Anthropic / Google

POST /v1/chat/completions
OpenAI-shaped
Standard chat completions. Pass x-tokenone-conversation-id for thread continuity.
POST /v1/messages
Anthropic-shaped
Anthropic Messages API shape. Same routing, same ledger.
POST /v1/google/generateContent
Google-shaped
Gemini-shaped endpoint. Same routing, same ledger.
GET /v1/models
catalogue
Returns the catalogue of models eligible for routing under your tenant.
GET /health
Liveness probe. Always 200 if the API is up.
Authentication uses your tp_dev_* or tp_live_* key in the Authorization: Bearer header. Keys rotate with a 24h overlap window — old key keeps working for 24h after rotation.

Tenant endpoints — wallet, ledger, baseline, analytics

GET /api/tenant/wallet
Returns current balance, reserved, debited, runway in days.
POST /api/tenant/wallet/topup
Initiate a Stripe top-up. Body: { amountMicros }.
GET /api/tenant/ledger
Paginated ledger entries. Filterable by date, type, project.
GET /api/tenant/ledger/verify
Walks the chain. Returns { verified: bool, firstBroken: string | null }.
GET /api/tenant/baseline
Returns the currently-selected benchmark provider key.
PATCH /api/tenant/baseline
Update the benchmark provider. Body: { providerKey: 'anthropic' | 'openai' | ... }.
GET /api/tenant/insights/overview
The Executive Health response — every tile on /overview comes from this one call.
GET /api/tenant/insights/activity
Live activity feed. Supports search, project filter, channel filter.
GET /api/tenant/insights/usage
Usage rollups: per task family, per project, per hour.
GET /api/tenant/insights/savings
Per-day actual vs baseline-equivalent series.
GET /api/tenant/insights/audit
Decision summaries + change log + export log.

User endpoints — profile, sessions, integrations

GET /api/users/me
Current user's profile. Includes timezone, bio, avatarUrl, emailVerifiedAt.
PATCH /api/users/me
Update profile fields. Validates against the same Zod schema the UI uses.
GET /api/users/me/sessions
All active sessions for this user.
DELETE /api/users/me/sessions/:id
Revoke a session. Forces refresh-token invalidation immediately.
POST /api/auth/refresh
Refresh the 15-minute access token using the 7-day refresh token.

Admin endpoints — learning plane evidence

GET /api/admin/learning/proposals
List minted proposals. Filterable by status, priority, source signal.
GET /api/admin/learning/proposals/:id
Full proposal detail incl. all gate-result rows + cost summary + synthetic batch summary.
GET /api/admin/learning/proposals/:id/synthetic
List synthetic batches + cases for this proposal.
GET /api/admin/learning/proposals/:id/replay
List replay runs + results for this proposal.
GET /api/admin/learning/proposals/:id/gates
Gate evaluation history — both Gate 1 and Gate 2 rows.
GET /api/admin/learning/proposals/:id/cost
Validation cost summary + breakdown.
GET /api/admin/learning/budget
Per-window budget rows with spent / available.
PATCH /api/admin/learning/budget/:id
Set the budget for a category in the current window. Auditable.
Every admin endpoint above is READ-ONLY except the budget PATCH. Phase 2 does not expose approve / reject / publish / promote endpoints — those land in Phase 3+ alongside the governance approval flow.

Section 7

Chain-verified ledger — what each column means.

The ledger is the source of truth for every wallet movement. Every entry has the previous entry's seal hash baked into its own HMAC; the chain is verifiable end-to-end with one API call.

Every column on every ledger row

id
UUID
Row id. Stable; surfaces on activity-feed deep links.
tenantId
UUID
Owner tenant. Always your tenant on customer-facing views.
projectId
UUID?
Which project the entry attributes to. Nullable for tenant-wide events like top-ups.
eventType
enum (internal)
WALLET_TOPUP / AI_USAGE / REFUND / ADJUSTMENT. The customer view maps these to plain labels.
customerLabel
string
The plain-English label rendered in /settings/ledger. Locked vocabulary: Top-up / AI usage / Refund / Adjustment.
amountMicros
BigInt signed
Tokens debited (negative) or credited (positive). BigInt — strings at the API edge.
balanceAfterMicros
BigInt
Wallet balance after this entry was applied. Lets the inspector show a running balance without server-side recomputation.
modelId
string?
Internal-only. Which model the call routed to. Visible in admin / audit, scrubbed from customer-facing surfaces by policy.
providerKey
string?
Same — internal only.
benchmarkProvider
string?
The brand against which benchmark-equivalent burn was computed for this row.
benchmarkMethodologyVersion
string?
Version of the savings math used. Lets historic rows survive future methodology changes.
actualCostUsdMicros
BigInt?
Real USD cost of this row, in micros (1e6). Internal — feeds the ML learning plane.
baselineCostUsdMicros
BigInt?
What this would have cost at the benchmark provider's pricing. Internal.
benchmarkPricingVersion
string?
Version of the price book used. Future rows can use a newer book; historic rows keep the old one.
sealHash
hex
HMAC-SHA256 over (prevHash + canonicalised payload). The chain anchor.
prevHash
hex
The previous entry's seal hash. Mutating any entry invalidates every entry below it.
createdAt
timestamp
Server-stamped. Drives ordering + windowed queries.

Verification — how chain integrity is checked

The verify endpoint walks the ledger window in order. For each row, it recomputes HMAC(prevHash + canonicalPayload, LEDGER_HMAC_KEY) and compares it against the stored sealHash. The first mismatch is reported as firstBroken; everything below that row is suspect.

The current implementation has a known false-negative bug: it uses plain SHA-256 instead of HMAC-SHA256 to recompute. The bug is documented in the e2e test suite and is queued for a fix; the seal column itself uses HMAC correctly, so signed rows are tamper-evident — only the read-side verify reports false breaks.

Section 8

The savings story — locked vocabulary.

Five terms are the ONLY phrases used to describe burn-vs-baseline savings on customer-facing surfaces. No synonyms, no alternates. The lock applies to every label, axis, header, tooltip, button, empty state and helper string in the platform.

The five locked terms

Tokens saved
absolute count
Tokens TokenOne governed delivery preserved vs the benchmark provider. Replaces "Saved", "Saved this month", "Saved 30d".
% saved
ratio
Tokens saved as a share of benchmark-equivalent burn. Replaces "Saved %", "savings %".
Benchmark provider
brand
The customer-selected provider whose pricing is the comparison anchor. Replaces "baseline brand", "baseline model", "default model".
TokenOne burn
tokens
Real tokens consumed via TokenOne governed delivery — naming the actor instead of "Actual". Replaces "Actual burn" (retired 2026-05-27).
<Provider>-equivalent burn
tokens
What the same workload would have cost at the chosen benchmark provider's pricing. Renders parametrically as e.g. "Anthropic-equivalent burn", "OpenAI-equivalent burn"; falls back to "Benchmark-equivalent burn" when no provider is selected. Replaces "Baseline-equivalent burn" (retired 2026-05-27).

The five rules behind the math

  1. Provider-led, never model-led. Customers never see model identifiers (kimi-k2.5, gpt-4o, etc.) in primary copy. The benchmark is always a brand: OpenAI, Anthropic, Google, xAI, Meta.
  2. Empty state is honest. When tenants.baseline_provider_key is null, the chart shows "Set your benchmark provider to see savings" — never a faked 0% comparison.
  3. Audit columns are internal. benchmark_provider, benchmark_methodology_version, actual_cost_usd_micros, baseline_cost_usd_micros, benchmark_pricing_version on llm_call_logs are explainability fields for admins + the ML-learning plane — never rendered to customers.
  4. Adding a provider = registering it in BRAND_REGISTRY in the cost-defaults section + mirroring it in baseline-pricing.service.ts. Both registries must stay in sync.
  5. Historical rows don't change benchmark. Changing the picker applies to NEW calls. Historic rows keep the benchmark they were attributed to at the time.

Section 9

Glossary — every term used across the platform.

Every term that appears on any TokenOne surface, defined once. Alphabetical.

TokenOne burn
Real tokens consumed via TokenOne governed delivery in a window. Replaces the retired "actual burn" (2026-05-27).
&lt;Provider&gt;-equivalent burn
What the same workload would have cost at the benchmark provider's pricing. Renders as e.g. "Anthropic-equivalent burn", "OpenAI-equivalent burn"; falls back to "Benchmark-equivalent burn". Replaces the retired "baseline-equivalent burn" (2026-05-27).
benchmark provider
The brand the customer chose as the savings comparison anchor.
BigInt
JavaScript big-integer type. Used for token counts and micros to avoid integer-overflow truncation at the API edge.
caseHash
sha256 of canonicalised inputBlob on a synthetic case. Used for de-duplication so re-running generation is a no-op.
cheap_model
Tier B generation method tag. Marks cases produced by a cheap upstream model (Tier B), as opposed to template (Tier A) or frontier (Tier C, disabled).
compute
Backend term. NOT used in customer-facing copy — replaced by "delivery".
connector tier
One of the six integration shapes (Proxy / MCP / Browser / Desktop / Copy-paste / Advisory). Used to pick the right setup wizard.
dispatch path
The runtime route the customer's call took (provider + model + region). Logged on llm_call_logs.
evidence
Aggregated outbox events grouped by content hash. The first stage where the learning plane filters noise out of raw traffic.
frontier
Tier C generation tag. Phase 2 has this scaffolded but disabled; do not enable until Phase 3+.
Gate 1
Synthetic-quality gate. Passes when acceptedCount / caseCount ≥ policy.minQualityThreshold.
Gate 2
Replay gate. Passes when passedCount / caseCount ≥ the configured replay threshold.
governed delivery
TokenOne's framing for "routed AI request with policy enforced before latency/cost optimisation". The phrase you use in customer copy.
HMAC seal
HMAC-SHA256 over (previous-row-hash + canonical-payload). The ledger's tamper-evident anchor.
idempotency key
Caller-supplied string that pins a budget debit (or any retryable operation) to one outcome. Same key = same result.
insights-engine
Read-only aggregator that produces every customer-facing chart and table from llm_call_logs + wallet + ledger + request_events.
ledger
Append-only signed log of every wallet movement. Source of truth.
learning plane
The asynchronous ML layer above the live plane. Never sits in the hot path.
live plane
The runtime layer that handles every customer call. Fast, deterministic, rules-first.
manifest
A bundle of approved learning-plane changes ready to promote. NOT written in Phase 2 — that's Phase 3+.
micros
USD micros = 1e6 per dollar. Token counts and money amounts are stored in micros + BigInt to avoid floating-point.
minted
Proposal status. Phase 1 produces minted proposals; Phase 2 leaves them on this status throughout.
model
Backend term. NOT used in primary customer copy. The customer picks a benchmark BRAND, not a model.
outbox event
One row per dispatch. The raw input to the learning plane.
pattern
Rolled-up evidence grouped by classifier features. Signals fire against patterns.
pivot detection
The detector that flags when a user appears to have switched projects mid-conversation. Suppresses broad project-memory retrieval at high scores.
project memory
Per-(tenantId, projectId) durable facts and decisions surfaced into prompts. Built behind a feature flag — see /smartone workspace settings.
proposal
A candidate rule the learning plane has minted from a signal. Validated by Phase 2; promoted by Phase 3+.
reservation
Wallet earmark for an in-flight call. Released on completion or failure so balance never lies.
replay
Phase 2 stage that runs accepted synthetic cases through the proposal's would-be rule and records pass/fail.
runway
balance ÷ rolling daily burn. Shown as "X days at current pace".
signal
A learning-plane detector that fires when a pattern crosses a threshold. Six signal types in Slice 1.
SmartOne
The runtime routing engine. Layer 1 (model class) + Layer 2 (compute) + Layer 3 (QA feedback).
synthetic batch
One generation run for one proposal under one policy. Output: a set of synthetic test cases.
task family
Coarse classification of a request (coding / writing / research / data-analysis / etc.). Drives routing.
tenant
A customer account. One wallet per tenant; one or more users per tenant; one or more projects per tenant.
Tier A
Template-based deterministic synthetic generator. Free, fast, the default.
Tier B
Cheap-model synthetic generator. Mock by default, live opt-in. Budget hard-bounded.
Tier C
Frontier-model synthetic generator. Scaffolded but DISABLED in Phase 2.
tokens saved
The headline KPI. Tokens TokenOne governed delivery preserved vs the benchmark.
value tier
A | B | C | D on a memory object. Drives retrieval policy. A = always retrievable; D = cold-storage.
wallet
One balance per tenant. Tops up via Stripe; debits via AI usage; reconciles via the ledger.
workspace
A project context inside the tenant. Carries its own budget + quality floor + integrations.

Something missing from this guide?

This page documents every shipped function and report at the time of writing. New features land monthly; if you've hit a surface that isn't covered, that's a doc gap and we want to know.