# Liquid Inference vs Cloudflare AI Gateway

Cloudflare AI Gateway is a proxy for your AI traffic. It adds logs, a cache and rate limits, and it sends each request to the provider that you name. With Unified Billing, you can pay six providers through Cloudflare credit. Liquid Inference is an exchange. Providers quote their own prices, and each request starts an auction among the offers that meet your rules.

The facts about Cloudflare AI Gateway come from its own pages, checked on 10 November 2026. The links are in [Sources](#sources).

## Feature by feature

| Feature                   | Cloudflare AI Gateway                                                             | Liquid Inference                                                    |
| ------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| Price                     | The provider's list price                                                         | Each provider quotes its own price                                  |
| Provider choice           | You name it. You can add a fallback list or a dynamic route                       | An auction: the lowest charge plus wait cost wins                   |
| Fee                       | 5% on credit. None with your own keys                                             | 5% of the charge, or a floor on cheap models. No top-up fee         |
| Providers on one bill     | Six, and Workers AI                                                               | Each provider on the exchange                                       |
| Cap for each request      | No                                                                                | Yes. `cap_usd`; the provider pays any usage above it                |
| Spend limits              | Partly. Up to 20 for each gateway. A burst can pass one                           | Yes. Exact, for each key, workspace, organization and end user      |
| Preview with no charge    | No                                                                                | Yes. The charge and cap of each offer, and why others are out       |
| Record of each request    | Partly. A log with a cost estimated from the token count                          | Yes. A receipt at the rates of the offer                            |
| No prompt logs by default | No. Logs can hold the prompt and the response. You can skip them for each request | Yes. The exchange stores no prompt or answer                        |
| No retention by default   | Partly. Provider ZDR only on Cloudflare credit                                    | Yes. Only offers that keep no prompt compete                        |
| Open to sellers           | No. You can add your own endpoint for your own use                                | Yes. By application; sellers post their own offers                  |
| Cache                     | Yes. An edge cache for identical requests                                         | Yes. Provider prompt caching, and a response cache for each request |

## What the exchange does that Cloudflare AI Gateway does not

- **One bill for every provider.** You pay each provider on the exchange from one balance, with no account at the provider.
- **Prices from competition.** Each provider quotes its own price for each model, and the auction buys the lowest cost. See [Price and wait](https://liquidinference.ai/docs/price-and-wait.md).
- **A hard cap for each request.** Send `exchange.cap_usd`, or the `x-liquid-cap-usd` header. See [Purchasing rules](https://liquidinference.ai/docs/rules.md).
- **An exact charge.** The receipt shows the charge from the metered usage and the rates of the offer, not an estimate. See [Receipts](https://liquidinference.ai/docs/receipts.md).

## When Cloudflare AI Gateway is the better choice

- You already have accounts with your providers, and you want logs, a cache and rate limits in front of them.
- Your app runs on Cloudflare Workers.

The two can work together. The exchange takes the OpenAI format, so you can add it to your gateway as a custom provider.

## Switch in one line

```diff
 client = OpenAI(
-    base_url="https://gateway.ai.cloudflare.com/v1/<account>/<gateway>/compat",
+    base_url="https://router.inference.ai.exchange/v1",
     api_key=...,
 )
```

Then change each `model` to a name that `GET /v1/models` lists. See [Connect an app](https://liquidinference.ai/docs/connect-overview.md).

## Questions

### Can I keep Cloudflare AI Gateway in front of the exchange?

Yes. Add the exchange as a custom provider with the base URL `https://router.inference.ai.exchange/v1` and your exchange key. Cloudflare then logs and caches the requests, and the exchange runs the auction.

### Does the exchange cache answers?

Yes, if you ask. Send `x-liquid-cache: true`, and an identical request from the same key gets the stored answer at no charge. Providers also cache prompts. See [Response caching](https://liquidinference.ai/docs/response-caching.md) and [Prompt caching](https://liquidinference.ai/docs/caching.md).

## Sources

Checked on 10 November 2026.

- Credit and providers on one bill: [Unified Billing](https://developers.cloudflare.com/ai-gateway/features/unified-billing/)
- Fees: [Pricing](https://developers.cloudflare.com/ai-gateway/reference/pricing/)
- Routing: [Dynamic routing](https://developers.cloudflare.com/ai-gateway/features/routing/dynamic-routing/), [Fallbacks](https://developers.cloudflare.com/ai-gateway/configuration/fallbacks/)
- Spend limits: [Spend limits](https://developers.cloudflare.com/ai-gateway/features/spend-limits/)
- Logs and cost: [Logging](https://developers.cloudflare.com/ai-gateway/observability/logging/), [Costs](https://developers.cloudflare.com/ai-gateway/observability/costs/)
- Custom providers: [Custom providers](https://developers.cloudflare.com/ai-gateway/configuration/custom-providers/)
- Cache: [Caching](https://developers.cloudflare.com/ai-gateway/features/caching/)
