By pointing Claude Desktop ↗ at AI Gateway instead of Anthropic directly, you get observability, caching, and centralized credentials for your Anthropic requests, without changing how you use Claude Desktop. Claude Desktop can send third-party inference requests to a custom gateway; this configuration sends those requests to AI Gateway's Anthropic endpoint, authenticated with your Cloudflare gateway token. AI Gateway can supply the Anthropic credentials for you through Unified Billing or a stored provider key (BYOK).
Before you start, you need:
- An authenticated gateway and its gateway token. The gateway token must have
Runpermissions. - Your Cloudflare account ID. To find it, refer to Find your account and zone IDs.
- Credentials for Anthropic requests. Use either Unified Billing credits or an Anthropic API key stored in AI Gateway as a provider key (BYOK).
- Claude Desktop installed and updated to the latest version.
-
In Claude Desktop, select Help > Troubleshooting > Enable Developer Mode.
-
Select Developer > Configure Third-Party Inference.
-
In Connection, set the connection type to Gateway.
-
In Gateway credentials, set Credential kind to Static API key.
-
Set Gateway API key to your Cloudflare gateway token.
Replace
<CF_AIG_TOKEN>with your gateway token.<CF_AIG_TOKEN> -
Set Gateway auth scheme to Bearer.
-
Set the gateway base URL to your gateway's Anthropic endpoint.
Replace
<ACCOUNT_ID>and<GATEWAY_ID>with your values.https://gateway.ai.cloudflare.com/v1/<ACCOUNT_ID>/<GATEWAY_ID>/anthropic -
In Models, add the Claude model you want to use.
Field Value Model ID claude-sonnet-4-5Display name Claude Sonnet 4.5Tier alias sonnet -
In Gateway credentials, select Test connection.
-
Start a Claude Desktop conversation. Requests now route through AI Gateway.
To confirm traffic reaches AI Gateway, refer to Verify it works.