> ## Documentation Index
> Fetch the complete documentation index at: https://infisical.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create

<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](/documentation/platform/secret-rotation/openai-service-account).

## Request body

| Field                | Type   | Required | Description                                                                                |
| -------------------- | ------ | -------- | ------------------------------------------------------------------------------------------ |
| `name`               | string | Yes      | A unique name for the connection.                                                          |
| `method`             | string | Yes      | Must be `"api-key"`.                                                                       |
| `credentials.apiKey` | string | Yes      | Your OpenAI [Admin API key](https://platform.openai.com/settings/organization/admin-keys). |

## Sample request

```bash theme={"dark"}
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 theme={"dark"}
{
  "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": {}
  }
}
```
