> For the complete documentation index, see [llms.txt](https://docs.north.cloud/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.north.cloud/docs/features/cost-loops/openai.md).

# OpenAI

Learn how to connect your OpenAI organization to North as a Cost Loop.

Connect your OpenAI Cost Loop integration with your North account to see usage costs across the various models OpenAI provides.

North reads your organization-wide OpenAI usage and spend through the OpenAI Admin API. One organization-scoped Admin key covers your whole organization.

## Before You Start

You need administrator access to your OpenAI organization, and your OpenAI organization ID. Find the ID in the OpenAI platform under **Settings**, then **Organization**, then **General**. Open the [OpenAI General settings](https://platform.openai.com/settings/organization/general) page to go there directly. The ID starts with `org-`.

## Connect OpenAI

{% stepper %}
{% step %}

### Open the Connect Screen

Open **Settings**, then **Integrations**, then **Add accounts**. Under **Cost Loops**, select **OpenAI**.
{% endstep %}

{% step %}

### Create an Admin Key

In the OpenAI platform, open **Settings**, then **Organization**, then **Admin keys**. Open the [OpenAI Admin keys](https://platform.openai.com/settings/organization/admin-keys) page to go there directly. Then:

1. Click **Create admin key**.
2. Name it `north`. The name is optional.
3. Set the expiration to **Never**.
4. Open the **Permissions** tab.
5. Toggle **Read** on the **Usage API** scope.
6. Click **Create admin key**.

{% hint style="warning" %}
Set the expiration to Never. If the key expires, North stops receiving your usage and cost data until you supply a new one.
{% endhint %}
{% endstep %}

{% step %}

### Enter Your Connection Details

Fill in the OpenAI fields:

* **Connection name.** A label to recognize this account by. It becomes the card title on your homepage.
* **OpenAI organization ID.** The `org-` value from your General settings.
* **Admin API key.** The key you just created.
  {% endstep %}

{% step %}

### Verify and Connect

Click **Verify & connect**. North checks the Admin API key against the OpenAI organization ID before it saves the connection.
{% endstep %}
{% endstepper %}

## What North Reads

North reads a cost report and a set of usage reports.

| Report | Frequency | Broken down by                 |
| ------ | --------- | ------------------------------ |
| Cost   | Daily     | Project, line item, API key    |
| Usage  | Hourly    | Varies by endpoint. See below. |

North reads usage from ten endpoints: completions, embeddings, moderations, images, audio speeches, audio transcriptions, vector stores, code interpreter sessions, file search calls, and web search calls.

Most usage endpoints break down by project, user, API key, and model. Two do not carry a model breakdown: vector stores and code interpreter sessions report by project only.

{% hint style="info" %}
Cost is daily, and usage is hourly. That is a property of the OpenAI Admin API, which does not accept an hourly bucket on the cost endpoint.
{% endhint %}

## After You Connect

OpenAI spend appears on your homepage as a card carrying your connection name. See [Viewing Cost Loop Data](/docs/features/cost-loops/viewing-cost-loop-data.md) for where else it shows up and at what detail.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.north.cloud/docs/features/cost-loops/openai.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
