Skip to main content
Infisical supports connecting to OpenAI using an Admin API Key. This connection is used to create and rotate OpenAI project service accounts via Secret Rotation.

Prerequisites

You need an OpenAI Admin API key created by an Organization Owner. Admin API keys are organization-scoped and can manage organization resources such as users, projects, and API keys. A regular project API key (for example, one starting with sk-) does not have these permissions and will fail validation.

Create an OpenAI Admin API Key

1

Open your account menu

In the OpenAI dashboard, click your account in the bottom-left corner to open the menu.OpenAI Account Menu
2

Open Organization settings

Select Organization settings from the menu.OpenAI Organization Settings
3

Navigate to Admin keys

In the organization settings, open the Admin keys tab.OpenAI Admin Keys Tab
4

Create a new Admin key

Click Create new Admin key on the top right corner.Create New Admin Key
5

Name and create the key

Give the key a descriptive name (e.g. infisical-key), set the permissions as needed, and click Create admin key.Name and Create Admin Key
6

Copy the Admin API key

Copy the generated Admin API key and store it securely. It will only be shown once.Copy Admin API Key
Create a dedicated Admin API key for Infisical rather than reusing an existing one. This makes it easy to rotate or revoke access independently.

Create OpenAI Connection in Infisical

1

Navigate to App Connections

In your Infisical dashboard, go to IntegrationsApp Connections tab in your project.App Connections Tab
2

Select OpenAI Connection

Click Add Connection and choose OpenAI from the list of available connections.Select OpenAI Connection
3

Fill out Connection Form

Complete the form with:
  • A name for the connection
  • An optional description
  • Your Admin API Key (from the steps above) OpenAI Connection Form
4

Connection Created

After clicking Connect to OpenAI, Infisical validates the key against the OpenAI API. Your OpenAI Connection is then ready to use for OpenAI Service Account Secret Rotation.OpenAI Connection Created