Unified Billing
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.
- Ensure your Cloudflare account has sufficient credits loaded.
- Ensure you have authenticated your AI Gateway.
To load credits for AI Gateway:
-
In the Cloudflare dashboard, go to the AI Gateway page.
Go to AI GatewayThe Credits Available card on the top right shows how many AI gateway credits you have on your account currently.
-
In Credits Available, select Manage.
-
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.
-
Select Top-up credits.
-
Add the amount of credits you want to purchase, then select Confirm and pay.
You can configure AI Gateway to automatically replenish your credits when they fall below a certain threshold. To configure auto top-up:
-
In the Cloudflare dashboard, go to the AI Gateway page.
Go to AI Gateway -
In Credits Available, select Manage.
-
Select Setup auto top-up credits.
-
Choose a threshold and a recharge amount for auto top-up.
When your balance falls below the set threshold, AI Gateway will automatically apply the auto top-up amount to 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.
For example, you can use the Unified API:
curl -X POST https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/compat/chat/completions \ --header 'cf-aig-authorization: Bearer {CLOUDFLARE_TOKEN}' \ --header 'Content-Type: application/json' \ --data '{ "model": "google-ai-studio/gemini-2.5-pro", "messages": [ { "role": "user", "content": "What is Cloudflare?" } ] }'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.
Unified Billing supports the following AI providers:
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-