> ## Documentation Index
> Fetch the complete documentation index at: https://docs.optimazehq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloudflare

> Connect a read-only Cloudflare Billing token so OPTIMAZE can import pay-as-you-go usage and cost.

Connect Cloudflare to OPTIMAZE with a read-only Billing token and your Account ID. OPTIMAZE imports pay-as-you-go usage and cost for the account, so you can attribute edge and network spend alongside your cloud providers.

> [!NOTE]
>
> Cloudflare is in beta. The tile on the **Integrations** page is marked **Beta**.

## Prerequisites

* A Cloudflare account with pay-as-you-go usage. Enterprise contract charges are not available through this connection.
* Permission to create API tokens on that account.

## Set up the Cloudflare integration

**1. Create a read-only Billing token in Cloudflare**

1. In the Cloudflare dashboard, open **My Profile**, then **API Tokens**.
2. Select **Create Token**, then **Create Custom Token**.
3. Add the permission **Account** > **Billing** > **Read**, limited to the account you want to import.
4. Create the token and copy it. Cloudflare shows it only once.
5. Copy the 32-character Account ID from the account overview page.

**2. Enter the details in OPTIMAZE**

Under **Data**, select **Integrations**. On the **Cloudflare** tile, select **Connect**, then fill in the form.

| Field | What to enter |
| :- | :- |
| **API token** | The Billing token you created |
| **Account ID** | The 32-character ID from the account overview page |
| **Display name (optional)** | A name to tell this connection apart from others |

**3. Connect**

Select **Connect**.

## What happens next

When you select **Connect**, OPTIMAZE runs a connection check before it starts importing. Each part of the check shows as passed, failed or not checked, and a later part is not checked when an earlier one fails.

| Check | What it confirms |
| :- | :- |
| **Authentication** | The credentials were accepted |
| **Access** | The credentials can read billing and usage data |
| **Required objects** | Anything you had to create in your own account exists. Not checked for providers that need nothing beyond credentials |
| **Data available** | There is cost data to import |

Once the check passes, the integration appears under **Connected** on the **Integrations** page. OPTIMAZE imports the previous six months of history on the first sync, and each later sync re-reads the last three days to pick up late changes.

If the account has no pay-as-you-go usage, the connection still works but no cost data appears, and the integration shows **No self-serve usage found**.

## Troubleshooting

* **Authentication** fails: the token is wrong or revoked. Create a new token and connect again.
* **Access** fails: the token is missing **Account** > **Billing** > **Read**, or is limited to a different account.
* **No self-serve usage found**: the account is billed under an enterprise contract. Those charges are not available through this connection.
* **Data available** fails: Cloudflare has no cost data for the period yet. Wait for Cloudflare to report usage, then connect again.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.