Developers
Build on the growth OS
Every capability in MarketWar OS is a deterministic engine behind a clean API. One provider-neutral gateway, one ACU billing model, one normalised response schema — provider identity and cost are never exposed.
Principles
- No AI provider key in the frontend; no direct browser-to-provider request.
- One internal contract (ModelGate) regardless of provider — OpenAI, Anthropic, Google or future models.
- Every AI request gets a request id; every billable op an idempotency key.
- ACUs are reserved before execution and reconciled after; provider failure never charges the customer.
- Models live in a central registry; provider prices are configurable without a code deploy.
The gateway contract
POST /api/modelgate // classify · route · reserve · reconcile · compare POST /api/subscription // quote-acus · plan · upgrade · contribution POST /api/webhooks/stripe // subscription -> ACU allocation (idempotent) // Pricing rule (utility-company economics): Required ACUs = ceil(providerCostGBP x 4 x 100) // 4x = 300% markup = 75% margin // £1 = 100 ACUs. Provider cost is used internally only, never returned.
The engine catalogue
38 engines are live behind their own API today — each with a GET that returns a doctrine plus a fully-populated demo (zero config, no keys). Explore them in the in-app AI Engines index.
/api/modelgate/api/subscription/api/admin-billing/api/comms-events/api/acu/api/admin-economics/api/profit-guard/api/compliance/api/rights-guard/api/lead-harvest/api/campaign-architect/api/creative-optimizer…and 26 more.
Auth & security
Requests carry a Firebase ID token + App Check token; the Vercel BFF verifies both before forwarding to the gateway. Secrets live in managed secret storage — never in the browser, Firestore, or git. Financial collections are Admin-SDK-write-only; clients can never modify a balance directly.
Full public API keys and rate-limited developer plans roll out with the production gateway release.
