Skip to content

Cloudflare AI Gateway can now cap spend and model access by identity

New policies let you allow, block or cap model usage per user, team or IdP group, and they replace the old spend limits feature outright.

Source: Cloudflare

Cloudflare AI Gateway shipped policies today: rules that allow, block or cap model and provider usage based on who is actually making the request. Identity comes from Cloudflare Access, a user’s email or IdP group, or from custom metadata you attach to a request. A policy targets an identity and a set of models or providers, then allows it, blocks it, or caps its spend.

That means a team or an email domain can get a shared monthly budget, an individual user can get their own cap inside that shared budget, and a contractor group can be blocked from the expensive models entirely. Caps reset hourly, daily, weekly or monthly on UTC boundaries, and a “Test policies” option in the dashboard lets you simulate a request before it hits live traffic. A policy blocking a group looks like this:

{
  "name": "Block contractors from Claude Opus",
  "actor": "company:all",
  "resource": { "models": ["anthropic/claude-opus-*"] },
  "condition": "\"contractors\" in cf.user.groups",
  "action": { "type": "block" }
}

Why it matters: policies replace spend limits outright. Existing spend limit rules still work for now, but Cloudflare has a dedicated migration guide and the writing is on the wall. If your team set up spend limits on AI Gateway, budget time to move to policies rather than waiting for them to be switched off under you.

Share

Related reading

More from The Wire

All briefs