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

# Confluent Billing Setup

> Connect Confluent Cloud billing data to Costory.

> [tab] Terraform
>
> To install and authenticate the provider, see [Terraform setup](https://docs.costory.io/setup/terraform.md).
>
> ```hcl theme={null}
> terraform {
>   required_providers {
>     costory = {
>       source  = "costory-io/costory"
>       version = ">= 0.1.0"
>     }
>   }
> }
>
> variable "costory_api_token" {
>   type        = string
>   description = "Costory API token."
>   sensitive   = true
> }
>
> variable "confluent_api_key" {
>   type        = string
>   description = "Confluent Cloud API key."
>   sensitive   = true
> }
>
> variable "confluent_api_secret" {
>   type        = string
>   description = "Confluent Cloud API secret."
>   sensitive   = true
> }
>
> provider "costory" {
>   token = var.costory_api_token
> }
>
> resource "costory_billing_datasource_confluent" "main" {
>   name       = "Confluent Billing"
>   api_key    = var.confluent_api_key
>   api_secret = var.confluent_api_secret
> }
> ```

> [tab] Manual setup
>
> Open Costory and go to **Billing > Import new billing datasource > Confluent**. The stepper guides you through each field.
>
> 1. Create a Confluent Cloud API key and secret with billing access.
> 2. Provide the API key and secret. Costory provisions the connection and starts syncing.
>
> On first sync, Costory backfills up to **12 months** of historical data (depending on your Confluent account).

**What Costory includes**

* **Invoice-level billing** from Confluent Cloud.
* **Per-cluster and per-environment cost breakdown** (group by **Resource name** or **Sub account id**).

**What Costory does not include**

* **Confluent Platform (self-managed)** costs. Only Confluent Cloud is supported.
* **Support or professional services fees** outside the invoice API.


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