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.

ModelGate™ AI Gateway/api/modelgate
Subscription & Commercial/api/subscription
Admin Billing/api/admin-billing
Communication Events/api/comms-events
ACU Economics/api/acu
Owner Economics/api/admin-economics
ProfitGuard/api/profit-guard
Claims & Compliance/api/compliance
RightsGuard/api/rights-guard
Lead Harvest/api/lead-harvest
Campaign Architect/api/campaign-architect
Creative Optimizer/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.