> 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 OpenAPI provides.&#x20;

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**. It 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**. 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 and toggle **Read** on the **Usage API** scope.
5. 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 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 key against the 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 of them 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 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.north.cloud/docs/features/cost-loops/openai.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.
