# ClickHouse Cloud

> Connect a ClickHouse Cloud organization API key scoped to billing to LevelFour.

Source: https://docs.levelfour.ai/connectors/clickhouse


## Prerequisites

* A ClickHouse Cloud organization.
* Access to create an organization API key with the Billing role.

## Connect

### Create an API key in ClickHouse Cloud

In the ClickHouse Cloud console, go to **Settings > API Keys > New API key**. Assign the **Billing** and **Service** reader roles, set an expiration, and generate the key.

Copy the Key ID, the Key Secret, and your Organization ID.

### Add it to LevelFour

Open **Connect Providers**, select **ClickHouse Cloud**, and paste the three values. Click **Add API key ID**.

## Confirming it worked

The connection moves to **Connected**. Your first data appears within a day.

## Rotating or removing access

### Rotating the credential

Create a new API key in ClickHouse Cloud, paste it into **Connect Providers**, then delete the old key.

### Removing access

Disconnect ClickHouse Cloud under **Connect Providers**, then delete the API key from ClickHouse Cloud's **Settings > API Keys**.

## Troubleshooting

| Symptom                                                | What to do                                                                                                                             |
| ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| The connection fails with a forbidden error            | The key needs the Billing role specifically. Service reader alone is not enough to read cost data                                      |
| The connection stops working after the expiration date | ClickHouse Cloud API keys expire on the date you set. Create a new one and update it under Connect Providers                           |
| Costs also show up on your cloud marketplace invoice   | If your organization is billed through AWS, GCP, or Azure Marketplace, ClickHouse spend appears there too. Do not add the two together |

## Next

* [Connect Providers](/connectors) lists every provider you can connect
