Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
/src/content/docs/workers-ai/ @rita3ko @craigsdennis @markdembo @mchenco @cloudflare/pcx-technical-writing
/src/content/docs/vectorize/ @elithrar @vy-ton @sejoker @mchenco @cloudflare/pcx-technical-writing
/src/content/partials/vectorize/ @elithrar @mchenco @sejoker @cloudflare/pcx-technical-writing
/src/content/partials/ai-gateway/ @abhishekkankani @palashgo @thebongy @roerohan @kathayl @mchenco @cloudflare/pcx-technical-writing
/src/content/release-notes/workers-ai.yaml @kathayl @mchenco @cloudflare/pcx-technical-writing
/src/content/release-notes/ai-gateway.yaml @kathayl @mchenco @cloudflare/pcx-technical-writing
/src/content/release-notes/ai-gateway.yaml @abhishekkankani @palashgo @thebongy @roerohan @kathayl @mchenco @cloudflare/pcx-technical-writing
/src/content/release-notes/vectorize.yaml @elithrar @mchenco @sejoker @cloudflare/pcx-technical-writing
/src/content/docs/ai-search/ @rita3ko @irvinebroque @aninibread @cloudflare/pcx-technical-writing

Expand Down
58 changes: 35 additions & 23 deletions src/content/docs/ai-gateway/features/unified-billing.mdx
Original file line number Diff line number Diff line change
@@ -1,46 +1,57 @@

---
pcx_content_type: configuration
title: Unified Billing
sidebar:
order: 1
group:
badge: Beta
head: []
description: Use the Cloudflare billing to pay for and authenticate your inference requests.
---

:::caution
Unified Billing is in closed beta. Request for access.
:::
import { DashButton } from "~/components";

Unified Billing allows users to connect to various AI providers (such as OpenAI, Anthropic, and Google AI Studio) and receive a single Cloudflare bill. To use Unified Billing, you must purchase and load credits into your Cloudflare account in the Cloudflare dashboard, which you can then spend with AI Gateway.

## Pre-requisites

Unified Billing allows users to connect to various AI providers (e.g. OpenAI, Anthropic) and receive a single Cloudflare bill. To use Unified Billing, users must purchase and load credits into their Cloudflare account, via the Dashboard, which can then be spent via the AI Gateway.
- Ensure your Cloudflare account has [sufficient credits loaded](#load-credits).
- Ensure you have [authenticated](/ai-gateway/configuration/authentication/) your AI Gateway.

## Load credits

### Load credits
To load credits for AI Gateway:

- Navigate to [AI Gateway](https://dash.cloudflare.com/?to=/:account/ai/ai-gateway) on Cloudflare dashboard
- The "Credits Available" card on the top right shows how many AI gateway credits you have on your account currently.
- Click "Manage" to navigate to the new billing page
- If you don't have a payment method already on your account, you will be prompted to "Add a payment method to purchase credits" on top of page.
- Once you have a card added, you will be able to do a credit top up on your account by clicking "Top-up credits", and then adding the required amount on the next popup.
1. In the Cloudflare dashboard, go to the **AI Gateway** page.

<DashButton url="/?to=/:account/ai/ai-gateway" />

The **Credits Available** card on the top right shows how many AI gateway credits you have on your account currently.

2. In **Credits Available**, select **Manage**.
3. If your account does not have an available payment method, AI Gateway will prompt you to add a payment method to purchase credits. Add a payment method.
4. Select **Top-up credits**.
5. Add the amount of credits you want to purchase, then select **Confirm and pay**.

### Auto-top up

- Navigate to [AI Gateway](https://dash.cloudflare.com/?to=/:account/ai/ai-gateway) on Cloudflare dashboard
- Click "Manage" on the "Credits Available" card on the top right to navigate to the new billing page
- Click the "Setup auto top-up credits" option on the dashboard, and set up a threshold and a recharge amount for auto topup.
You can configure AI Gateway to automatically replenish your credits when they fall below a certain threshold. To configure auto top-up:

1. In the Cloudflare dashboard, go to the **AI Gateway** page.

When your balance falls below the given threshold, we will automatically apply the auto topup on your account.
<DashButton url="/?to=/:account/ai/ai-gateway" />

### Using Unified Billing
2. In **Credits Available**, select **Manage**.
3. Select **Setup auto top-up credits**.
4. Choose a threshold and a recharge amount for auto top-up.

#### Pre-requisites
When your balance falls below the set threshold, AI Gateway will automatically apply the auto top-up amount to your account.

- Ensure your gateway is [authenticated](/ai-gateway/configuration/authentication/).
## Use Unified Billing

Call any supported provider without passing any API Key. The request will automatically use Cloudflare's key and deduct credits from your account.
Call any supported provider without passing an API Key. The request will automatically use Cloudflare's key and deduct credits from your account.

Example with Unified API:
For example, you can use the Unified API:

```bash
curl -X POST https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/compat/chat/completions \
Expand All @@ -57,15 +68,16 @@ curl -X POST https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/comp
}'
```

### Spend limit
### Spend limits

Set spend limits to prevent unexpected charges on your loaded credits. You can define daily, weekly, or monthly limits. When a limit is reached, the AI Gateway automatically stops processing requests until the period resets or you increase the limit.

### Supported providers

### Supported Providers
Unified Billing supports the following AI providers:

- [OpenAI](/ai-gateway/usage/providers/openai/)
- [Anthropic](/ai-gateway/usage/providers/anthropic/)
- [Google AI Studio](/ai-gateway/usage/providers/google-ai-studio/)
- [xAI](/ai-gateway/usage/providers/grok/)
- [Groq](/ai-gateway/usage/providers/groq/)
- [Groq](/ai-gateway/usage/providers/groq/)
60 changes: 58 additions & 2 deletions src/content/release-notes/ai-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,70 @@ link: "/ai-gateway/changelog/"
productName: AI Gateway
productLink: "/ai-gateway/"
entries:
# - publish_date: "2025-11-25"
# description: |-
# New easy to use [utility](/ai-gateway/integrations/utility/) for simplified AI Gateway integration. Drop `useAIGateway({ binding: env.AI })` anwhere in any worker project and AI requests will be automatically routed through AI Gateway.
- publish_date: "2025-11-21"
description: |-
Unified Billing now supports opt-in Zero Data Retention. This ensures supported upstream AI providers (eg [OpenAI ZDR](https://platform.openai.com/docs/guides/your-data#zero-data-retention)) do not retain request and response data.
- publish_date: "2025-11-14"
description: |-
- Supports adding OpenAI compatible [Custom Providers](/ai-gateway/configuration/custom/) for inferencing with AI providers that are not natively supported by AI Gateway
- Cost and usage tracking for voice models
- You can now use Workers AI via AI Gateway with no additional configuration. Previously, this required generating / passing additional Workers AI tokens.
- publish_date: "2025-11-06"
title: Unified Billing
description: |-
- [Unified Billing](/ai-gateway/features/unified-billing/) is now in open beta. Connect multiple AI providers (e.g. OpenAI, Anthropic) without any additional setup and pay through a single Cloudflare invoice. To use it, purchase credits in the Cloudflare Dashboard and spend them across providers via AI Gateway.
- publish_date: "2025-11-03"
description: |-
New supported providers
- [Baseten](/ai-gateway/usage/providers/baseten/)
- [Ideogram](/ai-gateway/usage/providers/ideogram/)
- [Deepgram](/ai-gateway/usage/providers/deepgram/)

- publish_date: "2025-10-29"
description: |-
- Add support for pipecat model on Workers AI
- Fix OpenAI realtime websocket authentication.
- publish_date: "2025-10-24"
description: |-
- Added cost tracking and observability support for async video generation requests for OpenAI Sora 2 and Google AI Studio Veo 3.
- `cf-aig-eventId` and `cf-aig-log-id` headers are now returned on all requests including failed requests
- publish_date: "2025-10-14"
description: The Model playground is now available in the AI Gateway Cloudflare Dashboard, allowing you to request and compare model behaviour across all models supported by AI Gateway.
- publish_date: "2025-10-07"
description: |-
- Add support for [Deepgram on Workers AI](/ai-gateway/usage/websockets-api/realtime-api/#deepgram-workers-ai) using Websocket transport.
- Added [Parallel](/ai-gateway/usage/providers/parallel/) as a provider.
- publish_date: "2025-09-24"
title: OTEL Tracing
description: |-
Added OpenTelemetry (OTEL) tracing export for better observability and debugging of AI Gateway requests.

- publish_date: "2025-09-21"
description: |-
- Added support for [Fal AI](/ai-gateway/usage/providers/fal/) provider.
- You can now set up custom Stripe usage reporting, and report usage and costs for your users directly to Stripe from AI Gateway.
- Fixed incorrectly geoblocked requests for certain regions.

- publish_date: "2025-09-19"
description: |-
- New API endpoint (`/compat/v1/models`) for listing available models along with their costs.
- Unified API now supports Google Vertex AI providers and all their models.
- BYOK support for requests using WebSocket transport.
- publish_date: "2025-08-28"
title: Data Loss Prevention
description: |-
[Data loss prevention](/ai-gateway/features/dlp/) capabilities are now available to scan both incoming prompts and outgoing AI responses for sensitive information, ensuring your AI applications maintain security and compliance standards.
- publish_date: "2025-08-25"
title: Dynamic routing
description: |-
Introduced [Dynamic routing](/ai-gateway/routing/dynamic-routing/) to help manage AI provider interactions effectively, ensuring your applications remain responsive and reliable.
Introduced [Dynamic routing](/ai-gateway/routing/dynamic-routing/) that lets you visually or via JSON define flexible request flows that segment users, enforce quotas, and choose models with fallbacks—without changing application code.
- publish_date: "2025-08-21"
title: Bring your own keys (BYOK)
description: |-
Introduced [Bring your own keys (BYOK)](/ai-gateway/configuration/byok/) allowing you to save your ai provider keys directly in the AI Gateway dashboard.
Introduced [Bring your own keys (BYOK)](/ai-gateway/configuration/bring-your-own-keys/) allowing you to save your AI provider keys securely with Cloudflare Secret Store and manage them through the Cloudflare dashboard.
- publish_date: "2025-06-18"
title: New GA providers
description: |-
Expand Down
Loading