Create an OpenAI API Key

An OpenAI API Key is required to connect OpenAI to Shopware, plugins, or other applications. The API Key is used to authenticate with the OpenAI API and can be created and managed through the OpenAI API Platform.

Table of contents

  1. Requirements
  2. Open the OpenAI API Platform
  3. Create an API Key
  4. Save and use the API Key
  5. API usage and billing
  6. Security recommendations

Requirements

The following requirements apply when creating an OpenAI API Key:

  • an OpenAI account,
  • access to the OpenAI API Platform,
  • if required, a configured payment method or API credit for using the API.

Note:
ChatGPT and the OpenAI API are managed and billed separately. An existing ChatGPT subscription therefore does not automatically include access to or credit for the OpenAI API.


Step 1: Open the OpenAI API Platform

  1. Open the OpenAI API Platform.
  2. Sign in with an OpenAI account.
  3. Open the API Keys section.

Existing API Keys can be managed and new keys can be created in this section.


Step 2: Create an API Key

  1. In the API Keys section, click Create new secret key.
  2. Enter a descriptive name for the API Key, for example Shopware or the name of the application in which the key will be used.
  3. Select the required project.
  4. If necessary, define the permissions for the API Key.
  5. Click Create secret key.
OpenAI API Key

Step 3: Save and use the API Key

After creation, the complete Secret Key is displayed. It should be copied immediately and stored in a secure location.

Important:
For security reasons, the complete Secret Key is only displayed when it is created. If the key is lost or was not saved, a new API Key must be created.

The copied API Key can then be entered in the corresponding field in Shopware, a plugin, or another application.


Step 4: Configure API usage and billing

OpenAI API usage is billed independently of ChatGPT. The costs depend, among other factors, on the model used and the actual API usage.

Billing information can be managed in the Billing section of the OpenAI API Platform. Previous API usage can be reviewed in the Usage section.


Security recommendations

An API Key should be treated like a password and protected accordingly.

  • Do not share or publish API Keys publicly.
  • Do not store API Keys directly in publicly accessible source code.
  • Use separate API Keys for different applications whenever possible.
  • Delete API Keys that are no longer required.
  • If unauthorized access is suspected, delete the affected API Key and create a new one.
  • Regularly review API usage and costs.

Note:
An API Key can be used to send requests to the OpenAI API. Unauthorized use may therefore result in additional costs. Secure storage of the API Key is particularly important.