Skip to content
Page cover
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Integrating with OpenAI

When you connect OpenAI to Drivetrain, your organization's projects, members, API keys, completions token usage, and daily cost breakdown sync automatically. You can then track and forecast AI spend next to the rest of your financials.

This guide walks you through creating an OpenAI Admin API key and adding OpenAI as a data source in Drivetrain.

The OpenAI connector is read-only. Drivetrain only pulls organization, usage, and cost data from OpenAI and never writes anything back.

Prerequisites

To connect OpenAI to Drivetrain, you need:

  • An OpenAI API Platform organization at platform.openai.com.

  • The admin or owner role in that organization. Only admins and owners can create Admin API keys. You can check your role in Organization settings > People.

  • Access to your Drivetrain workspace with permission to add data sources.

This connector covers usage and cost on the OpenAI API Platform. It doesn't sync ChatGPT workspace seats or subscriptions (ChatGPT Team or Enterprise).

What Drivetrain syncs from OpenAI

Once connected, Drivetrain pulls the following from your OpenAI organization:

  • Projects: the projects set up in your organization.

  • Members: the users in your organization.

  • API keys: the API keys created in your organization.

  • Completions token usage: tokens consumed by completions requests.

  • Daily cost breakdown: what your organization spends each day.

This data lands in Drivetrain as the following tables:

Table
What it contains
One row per

Costs

Billed cost in USD

Day, project and line item

Completions Usage

Input, output and cached tokens, and request counts

Day, project, user, API key and model

Projects

Projects in your organization

Project

Users

Members of your organization and their roles

User

Project Users

Members of each project

Project and user

Project API Keys

API keys in each project

API key

Admin API Keys

Admin keys in your organization

Admin key

Costs matches what OpenAI bills you, so use it for actuals. OpenAI only breaks billed cost down by project and line item, so use Completions Usage to analyze usage by model or API key.

OpenAI only makes the last 12 months of usage and cost available, so that's the history Drivetrain syncs. Each sync re-reads the last 3 days to pick up late cost adjustments from OpenAI.

OpenAI Setup: Create an Admin API key

Drivetrain connects with an Admin API key, which starts with sk-admin-. A standard project API key (sk-proj-...) doesn't have access to organization usage and cost data, so it won't work.

Step 1: Open Admin keys

  1. Sign in to the OpenAI API Platform.

  2. Click your profile icon in the bottom-left corner and select Organization settings.

  3. Click Admin keys in the left sidebar.

Step 2: Create the key

  1. Click + Create new Admin key.

  2. Enter a descriptive Name, such as Drivetrain Integration.

  3. Choose an Expiration. The default is Never.

  4. Set Permissions to Read only. Drivetrain only reads data, so it doesn't need broader access.

  5. Click Create admin key.

If you set an expiration, the connection stops syncing when the key expires. Create a new key and update the connection in Drivetrain before then.

Step 3: Copy and store the key

OpenAI shows the key only once and you can't retrieve it later. Copy it right away and store it in a password manager. You'll paste it into Drivetrain in the next section.

Drivetrain Setup: Add OpenAI as a data source

Step 1: Open Data and add a source

In Drivetrain, go to Data in the left navigation, then click the + button to add a new data source.

Step 2: Select the OpenAI connector

In the Connect a data source window, search for OpenAI and select it under AI & LLM Cost.

The Connect a data source window with Anthropic and OpenAI listed under AI & LLM Cost

Step 3: Enter your Admin API key

On the Connect your OpenAI account screen, paste the key you copied into the Admin API Key field, then click Submit.

The Connect your OpenAI account screen with the Admin API Key field

Step 4: Confirm the connection

OpenAI now shows as a connected data source and starts syncing. Your usage and cost data appears in Drivetrain once the first sync finishes.

If you have trouble connecting OpenAI or don't see your data after the sync, contact your Drivetrain CSM.

FAQ

Can I use a regular OpenAI API key instead of an Admin API key?

No. Only Admin API keys (starting with sk-admin-) can read your organization's usage and cost data. Project API keys can't.

Does this connector include ChatGPT subscription costs?

No. The connector syncs usage and cost from the OpenAI API Platform. ChatGPT Team and Enterprise seat costs aren't included.

Can I connect more than one OpenAI organization?

Yes. Add a separate OpenAI data source for each organization, each with its own Admin API key.

Last updated

Was this helpful?