Back to Infisical

Create

docs/api-reference/endpoints/app-connections/openai/create.mdx

0.162.21.4 KB
Original Source
<Note> Check out the configuration docs for [OpenAI Connections](/integrations/app-connections/openai) to learn how to obtain the required credentials. </Note>

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

bash
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

json
{
  "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": {}
  }
}