AI Gateway— governed model access as shared infrastructure.
A shared edge gateway between applications and model providers. Clients never receive provider credentials and do not bind product logic to a specific upstream model. Identity, request contracts, routing, spend controls, policy and telemetry are enforced at the platform boundary.
- Cloudflare Workers
- Durable Objects
- D1
- App Attest
- Turnstile
- Cloudflare Access
- TypeScript
- OpenAI / Kilo
Stack
Engineering evolution
Reconstructed from commit history. The sequence reflects technical changes visible in the repository; related commits are grouped into platform milestones.
The first control was deliberately simple: provider credentials remain server-side and applications call allowlisted capability routes instead of an unrestricted upstream proxy.
Once multiple applications share infrastructure, abuse and spend become architectural concerns. Durable Objects, usage accounting and daily/monthly budgets moved those controls into the request path.
Native apps gained App Attest and replay-protected challenges; browser clients can use origin policy and Turnstile. The platform supports heterogeneous clients without reducing every client to the weakest trust mechanism.
Logical routes were refactored into tiers and capability-specific endpoints. Provider or model migration becomes a platform concern instead of an application release concern.
Cost-aware and capability-aware routing, route decisions and feedback telemetry allow model selection to be evaluated rather than treated as opaque infrastructure.
Zero Trust around operational surfaces and fail-closed budget checks moved the gateway from a shared proxy toward infrastructure that can be operated across multiple products.
Developer contract
low, mid, high, coding and typed capability routes express product intent while isolating applications from provider churn.Governance & compliance model
Request path
Platform outcome
The application boundary is intentionally uneventful: a product asks for a capability; the platform authenticates, constrains, routes, meters and observes the request. That separation allows multiple AI features to operate under one policy model instead of becoming independent provider integrations.