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

# OpenAI

Turngate ingests audit logs from your OpenAI organization so you can monitor administrative actions across your ChatGPT Enterprise, ChatGPT Team, or API-only OpenAI organization.

## Setting Up

### Preparing your OpenAI Organization

To set up the OpenAI integration you must be an **Owner** of the OpenAI organization you want to connect. Audit log access is scoped at the organization level, so a single Data Source will cover all projects in that organization.

{% hint style="info" %}
The Audit Logs API is available on ChatGPT Enterprise, ChatGPT Team, and OpenAI API organizations that have an admin plan. If you do not see the **Admin keys** section described below, your organization may not have access enabled — contact OpenAI support.
{% endhint %}

1. Log in to the [OpenAI platform dashboard](https://platform.openai.com/) and switch to the organization you want to connect using the org switcher in the top-left.
2. Open **Settings → Organization → Admin keys**.
3. Click **Create new admin key**.
4. Give the key a descriptive name (e.g. `Turngate Audit Log Reader`).
5. Click **Create key** and copy the value immediately. OpenAI will not show it again.

You will also need your **Organization ID**, which is shown on **Settings → Organization → General** (it begins with `org-`).

### Setting up the OpenAI Data Source in the Turngate App

Once you have your admin key and Organization ID, head back to the Turngate App.

1. Click **Data Sources** in the navigation bar on the left.
2. Click **Install** on the **OpenAI** selection.
3. Give the Data Source a name for your own reference.
4. Paste in the **Organization ID** and **Admin Key** you generated above.
5. Click **Install**.

Turngate will validate the credentials and begin pulling audit logs. OpenAI retains audit logs for the past 30 days, and Turngate will backfill whatever is available at install time.

## What Gets Ingested

The OpenAI Audit Logs API exposes administrative events such as:

* User invitations, additions, removals, and role changes
* Project creation, updates, archival, and membership changes
* API key creation and deletion (both user and service account keys)
* Service account creation and deletion
* SSO and SCIM configuration changes
* Login events for users in the organization

Turngate does **not** ingest the content of prompts or completions — only administrative audit events.

## Other Resources

* [OpenAI Audit Logs API documentation](https://platform.openai.com/docs/api-reference/audit-logs)
* [Managing admin keys](https://platform.openai.com/docs/guides/production-best-practices/api-keys)
* [Audit log event types reference](https://platform.openai.com/docs/api-reference/audit-logs/object)


---

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

```
GET https://support.turngate.io/setup/integrations/openai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
