OpenAI configuration does not have a dedicated tab in the Nextian Settings; instead, it uses standard Salesforce integration mechanisms.
Follow these steps to configure OpenAI API access:
Create External Credential
- Go to Setup → Security → Named Credentials.
- Select External Credentials tab and click New.
- Fill the fields for the newly created credential as follows:
- Label = OpenAI
- Name = OpenAI
- Authentication Protocol = Custom
- Click Save. A new external credential is created.
- Open credential details and scroll down to the Principals
- Click New button in the Principals
- Fill the fields for the newly created principal as follows:
- Parameter Name = token
- Sequence Number = 1
- Identity Type = Named Principal
- Click Add to create Authentication Parameters and provide the following values:
- Name = token
- Value = <your OpenAI token>
- Click Save to save the principal.
Create Named Credential
- Go to Setup → Security → Named Credential.
- Select Named Credentialstab and click on New
- Fill the fields for the newly created credential as follows:
- Label = OpenAI Configuration
- Name = OpenAIConfiguration
- URL = https://api.openai.com/v1/chat/completions
- Enabled for Callouts = <selected>
- Authentication = <OpenAI> (from dropdown menu)
- Generate Authorization Header = <selected>
- Allow Formulas in HTTP Header = <selected>
- Allow Formulas in HTTP Body = <selected>
- Click Save.
- Open credential details and scroll down to the Custom Headers
- Click New to create a new custom header.
- Fill the fields for the newly created custom header as follows:
- Name = Authorization
- Value = Bearer {!$Credential.OpenAI.token}
- Sequence Number = 1
- Click Save.
- Click New button again and add one more header with the following values:
- Name = Content-Type
- Value = application/json
- Sequence Number = 2
- Click Save.
Add External Named Credential to Permissions Set(s)
These steps depend on the organization’s user configuration and should be applied to the permission sets of users requiring OpenAI access.
- Go to Setup → Users → Permission Sets.
- Select target permission set from the list.
- Click on External Credential Principal Access.
- Click on Edit.
- Move OpenAI – token from Available to Enabled.
- Click Save.
Important | Tracing OpenAI REST API calls for debugging and troubleshooting is configured via REST Callout Logging. |