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.
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.
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:
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
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
Sign in to the OpenAI API Platform.
Click your profile icon in the bottom-left corner and select Organization settings.
Click Admin keys in the left sidebar.
Step 2: Create the key
Click + Create new Admin key.
Enter a descriptive Name, such as Drivetrain Integration.
Choose an Expiration. The default is Never.
Set Permissions to Read only. Drivetrain only reads data, so it doesn't need broader access.
Click Create admin key.
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.

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.

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.
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?
