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

# Oracle Cloud Infrastructure Billing Setup

> Connect OCI native cost reports to Costory with an API signing key. Import Oracle Cloud spend into Explorer next to AWS, GCP, and Azure.

Oracle Cloud spend often sits outside your AWS, GCP, and Azure bills. Connect **Oracle Cloud** so native cost reports land in <Tooltip tip="Costory's main interface for exploring cloud costs across all connected providers." cta="See Glossary" href="/docs/glossary#cost-explorer">Explorer</Tooltip> with your other [billing datasources](/setup/billing).

This connector reads Oracle's proprietary **cost reports** from the tenancy `bling` bucket (`reports/cost-csv`). Costory generates an API signing key. You upload the **public** key on a dedicated IAM user. You never paste a private PEM.

<Warning>
  Use an **API signing key**, not a Customer Secret Key / HMAC. Costory talks to native Object Storage, not S3-compatible APIs. FOCUS cost reports are not on this connector.
</Warning>

<Tabs>
  <Tab title="Manual setup">
    <Steps>
      <Step title="Create a dedicated reader user">
        In the OCI Console, create an IAM user in a group such as `costory-oci-billing`. Do not use an administrator.

        Attach this policy on the **root** compartment. The `define tenancy` OCID is Oracle's public reporting tenancy. Do not replace it with your own tenancy OCID.

        ```
        define tenancy usage-report as ocid1.tenancy.oc1..aaaaaaaaned4fkpkisbwjlr56u7cj63lf3wffbilvqknstgtvzub7vhqkggq
        endorse group costory-oci-billing to read objects in tenancy usage-report
        ```

        That grant is read on Oracle cost reports in the `bling` namespace, under your tenancy OCID, at `reports/cost-csv`. See Oracle [Cost and Usage Reports](https://docs.oracle.com/en-us/iaas/Content/Billing/Concepts/costusagereportsoverview.htm).
      </Step>

      <Step title="Open Costory and copy the public key">
        Go to [Integrations](https://app.costory.io/integration), click **+ Add integration**, then choose **Oracle Cloud** under **Billing**. The connect URL is `/integration/new/oci/billing`.&#x20;

        Costory generates a key pair. Copy the **Public key** from the form. The fingerprint is derived from that key and should match the Console after you upload it. The private key stays in Costory and is never shown. Use **Regenerate** only if you need a new pair before saving.
      </Step>

      <Step title="Paste the public key on the OCI user">
        On the reader user, open **API keys > Add API key > Paste a public key**. Paste the generated public key. See Oracle [API keys](https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/managingcredentials.htm) and [request signing](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/signingrequests.htm).

        Do **not** create a Customer Secret Key / HMAC.
      </Step>

      <Step title="Copy identifiers and confirm reports exist">
        Copy the **user OCID** (`ocid1.user.oc1...`), **tenancy OCID** (`ocid1.tenancy.oc1...`), and tenancy **home region** (for example `eu-frankfurt-1`). Cost reports live in the home region.

        Confirm objects exist in [Cost and Usage Reports](https://cloud.oracle.com/billing/costUsageReports).
      </Step>

      <Step title="Enter connection details">
        Fill **Connection name** (default **Oracle Cloud**), **User OCID**, **Tenancy OCID**, and **Home region**.

        **Prefix** is optional. It defaults to `reports/cost-csv`. Do not add a trailing `/`.
      </Step>

      <Step title="Validate, then save">
        Click **Validate**. Costory signs a native Object Storage list of `reports/cost-csv` in the `bling` bucket. **Save** stays disabled until that list succeeds. An empty prefix is not success: Oracle always writes reports for metered tenancies. If this is the only billing source and it is demo data, Costory asks you to confirm before replacing it.
      </Step>
    </Steps>

    Costory copies existing cost-csv objects on first ingest. Check the datasource date range on [Integrations](https://app.costory.io/integration). New data then follows the usual [data refresh](/docs/data-refresh) cadence.
  </Tab>

  <Tab title="Terraform">
    Not supported yet.
  </Tab>
</Tabs>

## Field reference

| Field               | Required        | Description                                                                              |
| ------------------- | --------------- | ---------------------------------------------------------------------------------------- |
| **Connection name** | Yes             | Label in **Integrations**.                                                               |
| **User OCID**       | Yes             | OCID of the dedicated reader user (`ocid1.user.oc1...`).                                 |
| **Tenancy OCID**    | Yes             | Your tenancy OCID (`ocid1.tenancy.oc1...`). Also the default Object Storage bucket name. |
| **Home region**     | Yes             | Tenancy home region key, for example `eu-frankfurt-1`.                                   |
| **Public key**      | Yes (generated) | Costory generates it. Paste it on the OCI user. Never type a private PEM.                |
| **Fingerprint**     | Derived         | Colon-hex fingerprint of the generated key. Should match the Console after upload.       |
| **Prefix**          | No              | Object prefix. Defaults to `reports/cost-csv`.                                           |

Oracle-managed defaults you do not set: Object Storage namespace `bling`, bucket name = tenancy OCID.

## What Costory includes

Costory copies native cost reports from `reports/cost-csv` and maps them into <Tooltip tip="Costory's unified billing schema: the same dimensions everywhere (Provider, Billing account id, Service name, SKU ID, Region, Category, and more). In SQL and exports, column names use a cos_ prefix (for example cos_service_name)." cta="See Glossary" href="/docs/glossary#standard-columns">Standard Columns</Tooltip>.

Typical lines are the cost-csv rows Oracle already writes for that tenancy (service, SKU, compartment, and region as the export provides them).

**How to analyze Oracle Cloud costs**

* Spend by service: group by **Service name** or **SKU**
* Spend by compartment or region: group by the matching Standard Column when the export carries it
* Spend next to AWS, GCP, and Azure: filter **Provider** in Explorer

**What Costory does not include**

* FOCUS cost reports (`FOCUS Reports/...`)
* Deprecated `reports/usage-csv`
* HMAC / Customer Secret Key / S3-compatible access
* Live OCI Monitoring metrics

<Info>
  Rotate credentials from **Integrations**. Costory generates a new key pair. Upload the new public key on the same reader user. User OCID, tenancy OCID, home region, and destination stay the same.
</Info>

## Troubleshooting

| Issue                                 | What to check                                                                                                                                                                            |
| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Failed to authenticate                | Confirm you uploaded the **generated public key** on the reader user, not an HMAC Customer Secret Key. Recheck user OCID, tenancy OCID, fingerprint, and home region.                    |
| Access denied                         | Grant the reader user read on Oracle cost reports in the `bling` bucket (`reports/cost-csv`). Use the endorse policy above. Do not use an administrator key as a shortcut.               |
| Object Storage bucket not found       | For Oracle-managed cost reports the bucket name is your **tenancy OCID**. Confirm you pasted the tenancy OCID, not a compartment OCID.                                                   |
| No native cost reports at this prefix | Oracle stores them under `reports/cost-csv`. Confirm the tenancy is metered and **Home region** is the tenancy home region. FOCUS objects under `FOCUS Reports/` are not this connector. |
| Validation fails after Regenerate     | Upload the **new** public key on the OCI user. The previous key no longer matches.                                                                                                       |

## Related pages

<CardGroup cols={2}>
  <Card title="Billing Data" icon="database" href="/setup/billing">
    All billing providers and shared setup notes.
  </Card>

  <Card title="AWS billing" icon="aws" href="/setup/billing/aws">
    Connect AWS CUR 2.0 the same way you connect other clouds.
  </Card>

  <Card title="Azure billing" icon="microsoft" href="/setup/billing/azure">
    Import Azure Cost Management exports.
  </Card>

  <Card title="Explorer" icon="chart-line" href="/features/cost-explorer">
    Filter and group Oracle Cloud spend with the rest of your stack.
  </Card>
</CardGroup>
