Ontology · domain 6

Manifold — the meter-once inference gateway

Same cust-portal backend, manifold schema + manifold_app_dml role (migrations 098–110). OpenAI-compatible edge mounted at app root /v1 (not /api/v1).

6 objects · 0 links · 0 actions
Objects · every one cites its backing source
ManifoldKey
inference_key_service.py
format mfld_live_v1_<base62><crc32>; only HMAC-SHA256(pepper, raw) stored; capability split (inference vs management); allowed_models + spend_cap_cents scopes; denylist; 30s positive cache
SpendReservation
manifold.spend_reservation
durable pre-call gate — per-project $500 / per-key $200 in-flight ceilings
UsageEvent
manifold.usage_event outbox
one row per call, keyed sha256(org:project:provider_request_id) — the meter-once anchor
Relay settlement
manifold_relay.py
platform worker drains outbox → CreditService.consume_credits (exactly-once), releases reservation, dead-letters partial debits
ModelControlPlane
canonical_model / provider_model / model_routing_log
provider failover chain; BYOK custody via OpenBao
Unattributed spend
SYSTEM org wallet + unattributed_usage_alarm
alarm when a call can't be attributed
Notes, laws and mechanics

Request lifecycle

POST /v1/chat/completions
  → resolve key → (org, project) principal        (deny BEFORE provider: 401/403/402/404)
  → X-Project-Id header | body project_id | key self-scoping   (wrong project → 403)
  → pre-auth hardening: IP/ASN rate limit, disabled-model gate, 402 wallet gate
  → durable spend_reservation against org wallet
  → provider call (failover chain)
  → ONE usage_event outbox row (sha256(org:project:provider_request_id))
  → ManifoldRelay → wallet ledger (exactly-once) → release reservation

Endpoints

public edge /v1:  models · chat/completions (JSON|SSE) · embeddings · rerank · vision
account /v1:      credits · key · auth/key · usage · generation
management:       /api/v1/manifold/keys — create | byok | list | scope | rotate | revoke

manifold_access entitlement gates mint/rotate (fail-closed), not the hot path. manifold_sdk/ defines ports only (BillingPort/MeteringPort) with an isolation guard.

← 5. Commerce — two systems, one law7. Tenancy & Security — the substrate →