Skip to main content
Check out the configuration docs for OpenAI Connections to learn how to obtain the required credentials.
Creates an OpenAI app connection using an Admin API key. The connection can then be used for OpenAI Service Account secret rotations.

Request body

FieldTypeRequiredDescription
namestringYesA unique name for the connection.
methodstringYesMust be "api-key".
credentials.apiKeystringYesYour OpenAI Admin API key.

Sample request

curl --request POST \
  --url https://app.infisical.com/api/v1/app-connections/openai \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <ACCESS_TOKEN>' \
  --data '{
    "name": "my-openai-connection",
    "method": "api-key",
    "credentials": {
      "apiKey": "<YOUR-ADMIN-API-KEY>"
    }
  }'

Sample response

{
  "appConnection": {
    "id": "<connection-id>",
    "name": "my-openai-connection",
    "description": null,
    "version": 1,
    "orgId": "<org-id>",
    "createdAt": "<ISO8601>",
    "updatedAt": "<ISO8601>",
    "isPlatformManagedCredentials": false,
    "app": "openai",
    "method": "api-key",
    "credentials": {}
  }
}