> For the complete documentation index, see [llms.txt](https://docs.harmony.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.harmony.io/integrations/ai/chatgpt.md).

# ChatGPT

Discover your OpenAI organization members and track per-user token consumption via the OpenAI Admin API

Harmony's ChatGPT integration connects directly to the OpenAI Admin API, giving your IT and finance teams a unified view of your OpenAI organization's members, invites, and token consumption alongside all your other SaaS tools. Harmony pulls real data from the OpenAI API so you are working with actual token consumption figures rather than flat seat estimates - broken down by employee and model.

{% hint style="warning" %}
**This integration covers your OpenAI API platform organization, not a ChatGPT Enterprise workspace.** Harmony reads the `api.openai.com/v1/organization/*` Admin API endpoints, which enumerate developer platform organization members, invites, and API token usage. ChatGPT Enterprise workspace seats, conversations, and sign-ins are managed on a separate OpenAI surface that this integration does not connect to, so ChatGPT Enterprise seats will not appear in Harmony.
{% endhint %}

#### What the ChatGPT integration enables

| Capability             | Description                                                                                                                                                                               |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| User Discovery         | Surface the members of your OpenAI organization in Harmony's software inventory                                                                                                           |
| Seat Inventory         | Track organization members and pending or expired invites as seats, refreshed every 6 hours. Members are recorded as `active`; invites carry their OpenAI status (`pending` or `expired`) |
| Token Usage Tracking   | Monitor per-user, per-model token consumption from OpenAI's Completions usage endpoint, ingested daily                                                                                    |
| Usage Trends           | View each user's token consumption trend in the Activity column as daily usage accumulates                                                                                                |
| Multi-Instance Support | Connect multiple OpenAI organizations for teams with separate accounts                                                                                                                    |

#### Prerequisites

* **OpenAI Organization Owner**: Only organization owners can create Admin API keys
* **Admin API Key**: A key starting with `sk-admin-` (see below)
* **Harmony Account**: Active Harmony workspace

{% hint style="warning" %}
Only **Admin API keys** (starting with `sk-admin-`) are supported. Regular project API keys (`sk-proj-...`) and standard API keys (`sk-...`) will not work.
{% endhint %}

#### Connect ChatGPT to Harmony

**Step 1: Generate an Admin API Key**

1. Go to [OpenAI Platform admin keys](https://platform.openai.com/settings/organization/admin-keys) and sign in as an organization owner
2. Click **Create new admin key**
3. Enter a name (e.g. `Harmony Integration`) and click **Create**
4. Copy the key - it starts with `sk-admin-` and will not be shown again

{% hint style="info" %}
**Create new secret key** on the regular API keys page produces a project key (`sk-proj-...`), which this integration cannot use. Make sure you are on the **Admin keys** page.
{% endhint %}

**Step 2: Navigate to Integrations**

1. Log in to your Harmony dashboard
2. Go to **Settings** > **Integrations**
3. Find **ChatGPT** under **SaaS Applications** and click **Connect**

**Step 3: Enter Credentials**

1. Paste your **Admin API Key**
2. Click **Connect**

{% hint style="info" %}
For organizations with multiple OpenAI accounts, you can add multiple instances by repeating this process for each account.
{% endhint %}

#### Disconnect ChatGPT from Harmony

1. Log in to your Harmony dashboard
2. Go to **Settings** > **Integrations**
3. Find **ChatGPT** under **SaaS Applications** and click the integration card
4. Click **Disconnect**
5. Confirm the disconnection when prompted

Once disconnected, Harmony stops syncing data from OpenAI. Previously synced data remains available in Harmony. To fully revoke access, delete the Admin API key in the OpenAI Platform as well.

#### What Harmony Syncs

**From OpenAI:**

* Organization members (name, email, and OpenAI user ID), refreshed every 6 hours
* Member roles - OpenAI's platform roles `owner` and `reader`, shown in Harmony as admin and member
* Pending and expired invites, tracked as seats with their OpenAI status. Accepted invites are skipped because the person already appears in the member list
* Per-user, per-model token counts from OpenAI's Completions usage endpoint, ingested daily
* The OpenAI organization the Admin API key belongs to, used to group data per connected account

{% hint style="info" %}
**Token usage covers Completions only.** Harmony reads OpenAI's Completions usage endpoint. Usage of images, audio, embeddings, moderations, vector stores, web search, and file search is not collected, so totals understate consumption for organizations using those APIs. OpenAI's usage endpoint reports token counts only - it does not report cost.
{% endhint %}

{% hint style="info" %}
**Historical data on first connection:** Harmony backfills the last 7 days of token usage when you first connect, then keeps usage in sync with a daily poll. Longer usage trends build up from the connection date onwards.
{% endhint %}

#### Permissions Explained

The Admin API key is used read-only. Harmony calls three OpenAI endpoints:

| Endpoint                                 | Purpose                                                           |
| ---------------------------------------- | ----------------------------------------------------------------- |
| `GET /v1/organization/users`             | List organization members for the seat inventory, with their role |
| `GET /v1/organization/invites`           | List pending and expired invites as seats                         |
| `GET /v1/organization/usage/completions` | Collect per-user, per-model daily token counts                    |

#### Use Cases

<details>

<summary>AI Spend Management</summary>

Track token usage per user and model to allocate costs accurately and identify high consumers. Daily per-user token counts give you actual consumption data rather than flat seat estimates, so you can make informed decisions about your AI budget.

</details>

<details>

<summary>License Reclamation</summary>

Identify members with little or no recent token consumption and reclaim access to reduce OpenAI costs. Seat status labels (`active` for members, `pending` and `expired` for invites) make it easy to spot lapsed invitations at a glance.

</details>

<details>

<summary>Offboarding</summary>

Confirm OpenAI organization access has been removed when employees leave, as part of Harmony offboarding workflows.

</details>

<details>

<summary>AI Tool Adoption</summary>

Measure OpenAI API adoption across teams and departments to inform AI rollout decisions. Daily usage metrics show exactly how much each team member is consuming, including which models they are consuming tokens from.

</details>

#### Troubleshooting

<details>

<summary>The API key is rejected when connecting</summary>

**Possible causes:**

* The key is a project key (`sk-proj-...`) or a standard API key (`sk-...`) rather than an Admin API key
* The key was created by a member who is not an organization owner

**Solutions:**

1. Create the key on the **Admin keys** page at `platform.openai.com/settings/organization/admin-keys` using **Create new admin key**
2. Make sure the person creating the key is an owner of the OpenAI organization

</details>

<details>

<summary>My ChatGPT Enterprise seats are missing</summary>

**Possible causes:**

* This integration enumerates OpenAI API platform organization members and invites, which is a different population from ChatGPT Enterprise workspace seats

**Solutions:**

1. Expect to see the people who belong to your OpenAI developer platform organization. ChatGPT Enterprise workspace seats are not available through this integration

</details>

<details>

<summary>Usage data is missing or lower than expected</summary>

**Possible causes:**

* Only Completions usage is collected - images, audio, embeddings, moderations, vector stores, web search, and file search usage are not included
* Usage older than 7 days before the connection date is not backfilled
* Consumption that OpenAI cannot attribute to a specific user (for example traffic from an API key with no associated user) is not shown against a person

**Solutions:**

1. Wait for the daily usage poll to run after connecting, then check the Activity column
2. Compare against OpenAI's own usage dashboard, which includes the endpoints Harmony does not collect

</details>

#### Data & Privacy

<details>

<summary>Key privacy principles</summary>

For information about how Harmony handles your data, see our [Privacy Policy](https://harmony.io/privacy).

* Harmony reads OpenAI data in read-only mode and does not modify anything in your OpenAI organization
* Harmony does not read prompts, completions, or conversation content - only membership, invites, and aggregated token counts
* Access can be revoked at any time by disconnecting in Harmony or deleting the Admin API key in the OpenAI Platform

</details>


---

# 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.harmony.io/integrations/ai/chatgpt.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.
