> For the complete documentation index, see [llms.txt](https://docs.quper.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quper.co/integrations/data-warehouses-and-platforms/bigquery.md).

# Connect to BigQuery

Quper connects to BigQuery via a Service Account and tracks query costs, slot consumption, dataset storage, and spend by project, user, and dataset — giving data teams clear visibility into what is driving their BigQuery bill.

## What Quper tracks from BigQuery

* On-demand query costs by project, dataset, table, and user
* Slot consumption for flat-rate and reservation-based workloads
* Storage costs for active and long-term storage by dataset
* Query-level cost attribution — bytes processed, slot hours, and estimated cost per query
* Spend trends and anomalies in real time

## Before you begin

* You must have **Project Owner** or **BigQuery Admin** access in the GCP project you want to connect
* Quper supports connecting **multiple GCP projects** — repeat this process for each project, or connect at the billing account level via the [GCP integration](/integrations/cloud-providers/gcp.md) to cover all projects automatically

## Connection steps

{% stepper %}
{% step %}
**Go to Settings → Integrations**

In your Quper workspace, navigate to **Settings → Integrations** and click **Add Integration → BigQuery**.
{% endstep %}

{% step %}
**Create a Service Account**

In the Google Cloud Console, go to **IAM & Admin → Service Accounts** in your BigQuery project and create a new service account:

* Name: `quper-bigquery-reader`
* Description: Quper BigQuery read-only access
  {% endstep %}

{% step %}
**Grant the required roles**

Grant the service account the following roles on the project:

| Role                       | Why it's needed                                    |
| -------------------------- | -------------------------------------------------- |
| `BigQuery Data Viewer`     | Read dataset, table, and job metadata              |
| `BigQuery Job User`        | Run INFORMATION\_SCHEMA queries to pull usage data |
| `BigQuery Resource Viewer` | Read reservation and slot assignment data          |
| {% endstep %}              |                                                    |

{% step %}
**Download the service account key**

On the service account details page, go to **Keys → Add Key → Create new key → JSON**. Download the key file.
{% endstep %}

{% step %}
**Upload the key to Quper**

Back in Quper, upload the JSON key file and enter your GCP Project ID. Click **Connect**.

Quper verifies the service account permissions and begins ingesting BigQuery cost and usage data.
{% endstep %}
{% endstepper %}

## How Quper calculates query costs

For **on-demand pricing**, Quper calculates query cost using the bytes processed by each job and GCP's published on-demand rate for your region.

For **flat-rate and reservation pricing**, Quper tracks slot-hour consumption per project and reservation, and maps it to your committed slot spend to show effective cost per query.

## Enabling INFORMATION\_SCHEMA access

Quper uses BigQuery `INFORMATION_SCHEMA.JOBS` to pull per-query usage data. This view is available by default in all GCP projects. No additional setup is required.

{% hint style="info" %}
INFORMATION\_SCHEMA job data is available for queries run in the **last 180 days**. Quper will backfill up to 90 days of data on initial connection.
{% endhint %}

## Troubleshooting

**"Access denied" on INFORMATION\_SCHEMA queries** Ensure the service account has `BigQuery Job User` at the project level. The `BigQuery Data Viewer` role alone is not sufficient to run INFORMATION\_SCHEMA queries.

**Storage costs not appearing** Confirm the service account has `BigQuery Data Viewer` at the project level. Dataset-level permissions are not sufficient for Quper to enumerate all datasets.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.quper.co/integrations/data-warehouses-and-platforms/bigquery.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
