> ## 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.

# ClickHouse

> Connect ClickHouse Cloud with an API key so OPTIMAZE can import daily usage costs.

Connect ClickHouse Cloud to OPTIMAZE with a control-plane API key. OPTIMAZE imports daily usage costs for the organisation, and splits longer periods into 31-day windows automatically.

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

## Prerequisites

* Permission to create API keys in your ClickHouse Cloud organisation.

## Set up the ClickHouse integration

**1. Create an API key in ClickHouse Cloud**

1. In ClickHouse Cloud, open **Organization**, then **API keys**.
2. Create a key that can view the organisation. The read-only Developer role is enough.
3. Copy the organisation ID, key ID and key secret.

**2. Enter the details in OPTIMAZE**

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

| Field | What to enter |
| :- | :- |
| **Organisation ID** | Your ClickHouse Cloud organisation ID |
| **Key ID** | The API key ID |
| **Key secret** | The API key secret |
| **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.

## Troubleshooting

* **Authentication** fails: the key ID or secret is wrong, or the key has been deleted.
* **Access** fails: the key cannot view the organisation, or belongs to a different organisation.
* **Data available** fails: ClickHouse has no cost data for the period yet. Wait for ClickHouse to report usage, then connect again.


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