The External Secrets Enterprise product suite is a premium product.
It requires a specific subscription. Contact us for more information.
To use the OpenAI Generator, you must have the Enterprise Distribution of ESO available via ESI Agent or via our Helm chart bundle
Introduction
The OpenAI Generator allows automated management of OpenAI Service Accounts and their associated API Keys using the OpenAI Admin API. It simplifies the process of provisioning scoped credentials for different applications or environments, enabling secure, automated key rotation without manual intervention. This approach reduces operational overhead and enhances security posture by providing each workload with its own unique, managed API key.Output Keys and Values
Key | Description |
---|---|
api_key | The generated OpenAI API key (sk-... ). |
Parameters
Key | Default | Description |
---|---|---|
projectId | Required | The ID of the OpenAI project where the service account will be created. |
host | "https://api.openai.com/v1" | Base URL for the OpenAI Admin API. Typically the default endpoint is sufficient. |
openAiAdminKey | Required | Kubernetes secret reference holding the OpenAI Admin API Key used for authentication. |
serviceAccountNamePrefix | Optional | Prefix for the generated service account name. |
serviceAccountNameSize | 12 | Length of the randomly generated suffix for the service account name. |
Set up
Requirements
- An OpenAI project with Admin API Key.
Authentication
The Admin API Key must be stored in a Kubernetes secret and referenced in theopenAiAdminKey
field.
Example secret:
Generator Config
ExternalSecret Config
Using the generated secret
Notes and Considerations
- Each time the secret rotates, a new service account and API key are created.
- Service accounts are deleted during cleanup, ensuring no orphaned resources remain.
- The generator strictly requires the OpenAI Admin API; standard API keys for model inference are not sufficient.
- serviceAccountNameSize controls only the suffix length after any optional prefix.