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

# Infracost CLI

> Price Infracost estimates at the rates your CostGraph bill shows

CostGraph serves the pricing requests the Infracost CLI makes. Point the CLI at
CostGraph and its estimates use the prices you pay, not list prices.

## Before you begin

* A CostGraph API key with the `pricing:read` scope. Create one in
  **Settings > API keys**.
* An Infracost API key, to price AWS, Azure, and Google Cloud resources. Without
  one, see [Without an Infracost key](#without-an-infracost-key).

## Connect your Infracost key

In CostGraph, open Integrations, choose Infracost, and paste the API key your
Infracost CLI already uses. Print it with `infracost configure get api_key`.
Connecting a new key replaces the old one. You need to be an organization owner,
admin, or billing admin.

## Point the CLI at CostGraph

Set two environment variables before you run `infracost`. The value is your
CostGraph API key, not your Infracost key.

<Tabs>
  <Tab title="CLI v0.10">
    ```shell theme={null}
    export INFRACOST_PRICING_API_ENDPOINT=https://api.costgraph.ai/api/v1/tenant/infracost
    export INFRACOST_API_KEY=bl_your_key
    ```
  </Tab>

  <Tab title="CLI v2">
    ```shell theme={null}
    export INFRACOST_CLI_PRICING_ENDPOINT=https://api.costgraph.ai/api/v1/tenant/infracost
    export INFRACOST_CLI_PRICING_API_KEY=bl_your_key
    ```
  </Tab>
</Tabs>

Run `infracost breakdown` as usual.

## What changes

AWS, Azure, and Google Cloud prices come from Infracost with your key. Other
providers come from CostGraph prices.

Prices reflect what your bill shows you pay for each SKU over the last 30 days.
SKUs you haven't used yet show list price.

Bill-rate adjustment applies to AWS. Azure and Google Cloud show list price.

## Without an Infracost key

AWS, Azure, and Google Cloud lines are priced from CostGraph prices where
CostGraph has the exact item. Other lines show as not found.

## Errors

| Message | What to do |
| - | - |
| Infracost rejected the connected API key; reconnect it in CostGraph | Connect a valid Infracost key again. |
| Infracost pricing is unavailable; retry | Run the command again. |
| CostGraph did not accept this API key | INFRACOST\_API\_KEY must be a CostGraph API key with pricing read access, not your Infracost key. |


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