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
- How much have I spent and how much have I saved? — see /overview + section 8.
- Which calls did TokenOne actually make on my behalf, and why? — see /analytics + /settings/ledger.
- 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% savedBenchmark providerTokenOne burn<Provider>-equivalent burnSection 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.
balancereserveddebitedrunwayauto-topupTop-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 familycomplexityquality floorapproved delivery pathescalationPillar 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.
- Proxy — drop-in OpenAI / Anthropic / Google-compatible endpoints. One env var change.
- MCP server — Claude Desktop and any MCP-aware client.
- Browser extension — for clients that can't be proxied.
- Desktop bridge — local app on the user's machine.
- Copy-paste — manual fallback.
- 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 hashprev hashevent typeamount microsproject idPillar 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.
accuracystructurehallucination riskinstruction fidelitySection 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 balanceTokens saved (30d)% saved (30d)TokenOne burn · 30dRunwaySavings chartLive activity feedtenants.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 tabSavings tabLedger tabAudit tabSearch filterEngine versions/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 selectorDeltaTop movers/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).
NameEmailemail_verified_at.TimezoneBioAvatar URL/billing — Wallet top-up + benchmark
Where you fund the wallet and choose the benchmark provider. Stripe lives here.
Add tokensAuto-topupBenchmark provider pickertenants.baseline_provider_key; every new call gets a baseline-equivalent comparator computed against this brand's pricing.Payment methodInvoices/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 sessionsAuto sign-outAPI tokensAudit log/notifications — Alerts + digest cadence
Two types of alerts: balance / runway thresholds and quality / escalation events. Configurable per channel (email / webhook).
Balance thresholdRunway thresholdEscalation alertDigest cadenceWebhook URL/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.
TileSetup wizardConnection testTier badge/developer-zone — API clients + tools + catalogue
The technical operator surface. Three sub-pages: Clients, Tools, Model Marketplace.
/developer-zone/clientstp_dev_xxx / tp_live_xxx. Rotation with 24h overlap window./developer-zone/tools/developer-zone/model-marketplace/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 switcherProject settingsActivity/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 typeAmountRunning balanceSeal hashVerify chain buttonSection 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.
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.
LearningOutboxEventLearningEvidenceLearningPatternLiveCoverageSnapshotLive*Signal (6 tables)LearningProposalminted 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.
LearningSyntheticGenerationPolicyLearningSyntheticBatchLearningSyntheticCaseLearningSyntheticQualityScoreLearningReplayRunLearningReplayResultLearningProposalGateResultLearningProposalValidationCostLearningPlaneBudgetWithdrawalGate 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 — syntheticGate 2 — replayproposal.gate1ResultIdproposal.gate2ResultIdproposal.statusValidation 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)totalValidationCostMicroscaseCountSyntheticcaseCountReplayrunCountproposal.validationCostMicrosproposal.lastValidatedAtTier A / B / C generators
Three synthetic generators, each with a different cost / quality / risk profile. The orchestrator dispatches based on policy.tier.
Tier A — templatemaxCasesPerBatch. The default for any policy that doesn't need open-ended generation.Tier B — cheap-modelLEARNING_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 — frontierenabled=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.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){withdrawalId, freshDebit}. freshDebit=false means the idempotency key matched an existing row — no second debit happened.BudgetExceededErroridempotencyKeysynthgen:synth:{proposalId}:{policyId}:{windowKey}. Same key = same withdrawal id.ensureBudgetsForWindow()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.
proposal.statusstays'minted'through every operation.- No approve / no reject (no writes to
approvedByUserId/rejectReason/approvedAt). - No publish / no promote (no manifest write path).
- No manifest (
proposal.manifestIdstays null). - No rollout / no rollback (not implemented in Phase 2).
- No runtime mutation (zero writes to
smart_router_*/llm_call_logs/ dispatch surfaces). - No live cheap-model promotion (Tier B mock-mode default; live opt-in never wired to dispatch).
- 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.
Tier 1 — Proxy
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't change base URL, use Tier 3 (Browser) or Tier 4 (Desktop).
Tier 2 — MCP 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're routed.
Watch for: Per-machine install. Auto-updates via the desktop bridge if it's also installed.
Tier 3 — Browser extension
Tools you can't proxy (web ChatGPT, web Claude, web Gemini).
Chrome / Edge extension. Intercepts the page'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.
Tier 4 — Desktop 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're running MCP across multiple clients.
Tier 5 — Copy-paste
Anyone whose tool simply can'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.
Tier 6 — Advisory
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/completionsx-tokenone-conversation-id for thread continuity.POST /v1/messagesPOST /v1/google/generateContentGET /v1/modelsGET /healthtp_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/walletPOST /api/tenant/wallet/topup{ amountMicros }.GET /api/tenant/ledgerGET /api/tenant/ledger/verify{ verified: bool, firstBroken: string | null }.GET /api/tenant/baselinePATCH /api/tenant/baseline{ providerKey: 'anthropic' | 'openai' | ... }.GET /api/tenant/insights/overviewGET /api/tenant/insights/activityGET /api/tenant/insights/usageGET /api/tenant/insights/savingsGET /api/tenant/insights/auditUser endpoints — profile, sessions, integrations
GET /api/users/mePATCH /api/users/meGET /api/users/me/sessionsDELETE /api/users/me/sessions/:idPOST /api/auth/refreshAdmin endpoints — learning plane evidence
GET /api/admin/learning/proposalsGET /api/admin/learning/proposals/:idGET /api/admin/learning/proposals/:id/syntheticGET /api/admin/learning/proposals/:id/replayGET /api/admin/learning/proposals/:id/gatesGET /api/admin/learning/proposals/:id/costGET /api/admin/learning/budgetPATCH /api/admin/learning/budget/:idSection 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
idtenantIdprojectIdeventTypecustomerLabelamountMicrosbalanceAfterMicrosmodelIdproviderKeybenchmarkProviderbenchmarkMethodologyVersionactualCostUsdMicrosbaselineCostUsdMicrosbenchmarkPricingVersionsealHashprevHashcreatedAtVerification — 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.
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% savedBenchmark providerTokenOne burn<Provider>-equivalent burnThe five rules behind the math
- 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.
- Empty state is honest. When
tenants.baseline_provider_keyis null, the chart shows "Set your benchmark provider to see savings" — never a faked 0% comparison. - Audit columns are internal.
benchmark_provider,benchmark_methodology_version,actual_cost_usd_micros,baseline_cost_usd_micros,benchmark_pricing_versiononllm_call_logsare explainability fields for admins + the ML-learning plane — never rendered to customers. - Adding a provider = registering it in
BRAND_REGISTRYin the cost-defaults section + mirroring it inbaseline-pricing.service.ts. Both registries must stay in sync. - 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).
<Provider>-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.