[Yandex Cloud documentation](../../index.md) > [Tutorials](../index.md) > [Building a data platform](index.md) > Processing usage detail files in Yandex Cloud Billing

# Processing files with usage details in Yandex Cloud Billing

The [Yandex Cloud Billing](../../billing/index.md) service is where you can get information about the amount of resources used, monitor your expenses, and pay for resource consumption. You can send your spending details to [Yandex Object Storage](../../storage/index.md) and then process them using [Yandex Query](../../query/index.md).

Yandex Cloud Billing and Query are integrated with each other. You can use preset queries to perform routine tasks for analyzing details of payments for resources or write custom [YQL queries](../../query/yql-tutorials/index.md).

![](../../_assets/query/billing-query.png)

Query provides ready-made queries to get the following information:

* Usage by month.
* Usage in the current month by service and product.
* Usage in the current month by cloud and folder.
* Top 10 most expensive resources.
* Payment for fixed usage.
* Fixed usage utilization.
* Details by Managed Service for Kubernetes cluster.

## Getting started {#before-you-begin}

Sign up for Yandex Cloud and create a [billing account](../../billing/concepts/billing-account.md):
1. Navigate to the [management console](https://console.yandex.cloud) and log in to Yandex Cloud or create a new account.
1. On the **[Yandex Cloud Billing](https://center.yandex.cloud/billing/accounts)** page, make sure you have a billing account linked and it has the `ACTIVE` or `TRIAL_ACTIVE` [status](../../billing/concepts/billing-account-statuses.md). If you do not have a billing account, [create one](../../billing/quickstart/index.md) and [link](../../billing/operations/pin-cloud.md) a cloud to it.

If you have an active billing account, you can create or select a [folder](../../resource-manager/concepts/resources-hierarchy.md#folder) for your infrastructure on the [cloud page](https://console.yandex.cloud/cloud).

[Learn more about clouds and folders here](../../resource-manager/concepts/resources-hierarchy.md).

## Set up integration between Yandex Cloud Billing and Query {#integration}

To set up integration:

1. Open the list of expense detail exports in the Yandex Cloud console.
1. Select the required details and click **Process in YQ**.
1. When switching from Yandex Cloud Billing to Yandex Query for the first time, set up integration:
   1. In the Query interface, select the service account for reading data from Object Storage in the connection creation dialog box and click **Create**.
   1. In the Query interface, check the preset settings by clicking **Preview** in the binding creation dialog. Next, click **Create** to complete the integration.
   1. Once you configure the integration, you will be redirected to **Billing**.

## Query the data {#query}

To query analytical data from Yandex Cloud Billing stored in Object Storage:

1. Under **Billing** in the Query interface, select the required [data binding](../../query/concepts/glossary.md#binding) from the list.
1. Select a query to Object Storage data from the list and click **Run**.

You can do the following with data processing results:

* Download them through the Yandex Query user interface by clicking **Export**.
* [Save them to an Object Storage bucket](../../query/sources-and-sinks/object-storage-write.md).
<!-- * [Visualize them](../../query/tutorials/datalens.md) in Yandex DataLens. -->
* Get and process them via the [Query HTTP API](../../query/api/index.md).

#### Useful links {#see-also}

* [Yandex Object Storage](../../storage/index.md)
* [Yandex DataLens](../../datalens/index.md)