AI gateways are currently in beta. Contact Opal support to enable them for your organization. If you self-host Opal, you need version
1.1252.0 or later.Overview
Cloudflare AI Gateway works as an AI gateway for Opal through its Anthropic endpoint. Opal sends the same model names it would send to Anthropic, and Cloudflare’s logging, policies, and spend controls apply to every call.Prerequisites
- A Cloudflare account with an AI gateway. Cloudflare creates a gateway named
defaulton its first request if you don’t have one. - A Cloudflare API token with the AI Gateway: Run permission, if your gateway requires authentication.
- An Anthropic API key.
Connect it in Opal
Follow Connect your gateway with:
Your account ID and gateway ID are in the Cloudflare dashboard, on the AI Gateway page. With authentication on, Cloudflare rejects calls that don’t carry the
cf-aig-authorization header, and Opal’s connection check reports “The gateway rejected the key”.
Cloudflare’s gateway log then shows each request Opal makes, with the model, status, tokens, and duration.