cd /news/ai-infrastructure/workers-ai-and-ai-gateway-using-ai-o… · home › topics › ai-infrastructure › article
[ARTICLE · art-152502] src=dev.to ↗ pub= topic=ai-infrastructure verified=true sentiment=↑ positive

Workers AI and AI Gateway: using AI on Cloudflare without scattering API keys

A developer described consolidating AI inference within Cloudflare to avoid scattering provider API keys across projects. Workers AI runs models through a Worker binding so no external key appears in code, while AI Gateway fronts external providers so the provider key lives in one place with caching, rate limits and logs on top. The writeup, published in Portuguese, covers the setup and the trade-offs encountered.

by read1 min views18 publishedOct 18, 2026
Workers AI and AI Gateway: using AI on Cloudflare without scattering API keys
Image: Dev.to

If you run several small projects, API keys tend to pile up: one per provider, copied into env files, CI secrets and old branches. Every copy is one more place a key can leak. One way out is to keep inference inside Cloudflare. Workers AI runs models from a Worker binding, so there's no external key in the code at all, and AI Gateway sits in front of external providers so the provider key lives in one place, with caching, rate limits and logs on top.

I wrote up how I set this up across my projects, with the trade-offs I hit along the way (in Portuguese):

https://kevinbk.com/blog/evitar-acumulo-de-chaves-api-em-projetos-ia

── more in #ai-infrastructure 4 stories · sorted by recency
── more on @cloudflare 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/workers-ai-and-ai-ga…] indexed:0 read:1min 2026-10-18 · —