OpenAI Dynamic Secrets
You can use Akeyless Dynamic Secrets to generate short-lived credentials that let you securely connect to OpenAI — no need to store or manage long-term API keys or worry about them being exposed.
Prerequisites
- An Akeyless Gateway
- An OpenAI Target
- an Admin API Key
Create an OpenAI Dynamic Secret with the CLI
To create a Dynamic Secret for OpenAI with the CLI using an existing OpenAI target, run the following command:
akeyless dynamic-secret create openai \
--name <New Secret Name> \
--target-name <Target Name> \
--project-id <Project ID>
--gateway-url 'https://<Your-Akeyless-GW-URL>:8000' Where:
-
name: A unique name of the dynamic secret. The name can include the path to the virtual folder where you want to create the new dynamic secret, using slash/separators. If the folder does not exist, it will be created together with the dynamic secret. -
target-name: A name of the target that enables connection to the OpenAI account. The name can include the path to the virtual folder where this target resides. -
project-id: The project in OpenAI where the API Ket will be created in. -
gateway-url: Akeyless Gateway URL (port8000).
Create a Dynamic OpenAI Secret in the Akeyless Console
Tip:To start working with Dynamic Secrets from the Akeyless Console, you need to configure the Gateway URL thus enabling communication between the Akeyless SaaS and the Akeyless Gateway.
-
Log in to the Akeyless Console, and go to Items, then New, then Dynamic Secret.
-
Select the OpenAI secret type and click Next.
-
Define a Name of the dynamic secret, and specify the Location as a path to the virtual folder where you want to create the new dynamic secret, using slash / separators. If the folder does not exist, it will be created together with the dynamic secret.
-
Define the remaining parameters as follows:
-
Delete Protection: When enabled, protects the secret from accidental deletion.
-
Target: Select an existing OpenAI Target.
-
Project ID: The Project ID where the new API Key will be created.
-
User TTL: Provide a time-to-live value for a dynamic secret. When TTL expires, the token becomes obsolete.
-
Gateway: Select the Gateway through which the dynamic secret will create users.
-
Protection key: To enable zero-Knowledge, select a key with a Customer Fragment. For more information, read here.
-
-
Click Finish.
Updated 6 days ago
