OpenAI Custom Endpoint OAuth2 Account
Overview
You can use this account type to connect OpenAI LLM Snaps with data sources that use custom endpoints through OAuth2.
By using this account instead of directly sending requests to the OpenAI endpoint, you can replace the base part (such as a schema, host, and port) of the original URL with your configured endpoint, while keeping the path and other segments unchanged. This base URL can be an APIM service URL with an authentication policy rule like the Callout Authenticator or a URL of another other service that uses the OpenAI API.

Prerequisites
- A proxy or service to connect to that complies with the OpenAI API specification and doesn't require any authentication. Learn more about the Account setup
Usage Guidelines
You can download this YAML file to start your APIM service in APIM 3.0.
Known Issues
When using the OpenAI Upload File Snap with this account and setting the endpoint to a service on API Manager,
an HTTP 500
error is returned.
This is due to the Transfer-Encoding
header.
Workaround: Add a transform policy in APIM to remove this header.
Account settings
- Expression icon (
): Allows using JavaScript syntax to access SnapLogic Expressions to set field values dynamically (if enabled). If disabled, you can provide a static value. Learn more.
- SnapGPT (
): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
- Suggestion icon (
): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
- Upload
: Uploads files. Learn more.
Field / Field set | Type | Description |
---|---|---|
Label | String |
Required. Specify a unique label for the account. Default value: N/A Example: crm |
Endpoint | String/Expression |
Required. Specify the endpoint to send the request to. Note: When you enable the expression for this
masked field, the value becomes visible in plain text format.
Default value: N/A Example:https://fm-cloud-snaplogic-apim.labs.snaplogicdev.com/service/OpenAI_API_4/2.3.0 |
Client ID | String | Required. Specify the client ID associated with your application. Default value: N/A Example: 1abcd23e-45fg-6789-hi01-23457hid1890 |
Client secret | String | Required. Specify the client secret associated with your account. You can create the client secret as advised by your application provider. Default value: N/A Example: bec1f9242f9nsh67f2276b9ws4dada16 |
Access token | String | Auto-generated after authorization. The access token associated with the portal application is used to make API requests on behalf of the user associated with the client ID. Default value: N/A Example: <Value encrypted> |
Refresh token | String | Auto-generated after authorization. The token used to refresh the access token.Note: To automatically retrieve the Refresh
token, you should set the scope in the authentication parameters to
store the resulting refresh token in this field. Default value: N/A Example: <Value encrypted> |
Access token expiration | String | Auto-generated after authorization. The access token expiration value. Default value: N/A Example: 1656423824 |
OAuth2 authorization endpoint | String | Required. Specify the authorization endpoint to authorize the application. Default value: https://accounts.google.com/o/oauth2/auth Example: https://login.microsoftonline.com/6f47e3b1-2b2a-4c2e-9b3f-58d2a340a8e3/oauth2/v2.0/authorize |
Read timeout (seconds) | Integer/Expression | Specify the time in seconds to wait for a response from Azure. Default value: 600 Example: 800 |
OAuth2 token endpoint | String | Required. Specify the tenant ID in the following format to get the access token. Example:https://oauth2.googleapis.com/token |
Token endpoint config | Use this field set to configure token endpoint parameters as necessary for the account. | |
Token endpoint parameter | String | Required. Specify the name for the token endpoint parameter. Default value: N/A Example: scope |
Token endpoint parameter value | String | Required. Specify the value for the parameter. Default value: N/A Example: redirect_uri |
Authorization endpoint config | Use this field set to configure authorization parameters for the authorization endpoint. | |
Authentication endpoint parameter | String | Required. Specify the authentication endpoint parameter. Default value: scope Example: code |
Authentication parameter value | String | Required. Specify the value for the authentication parameter. Default value: offline_access https://cognitiveservices.azure.com/.default Example:redirect_uri |
Auto-refresh token | Checkbox | Select this checkbox to refresh the access token automatically, using the refresh token, when the token is due for expiration. The token refresh does not happen automatically if this checkbox is not selected. You need to add Default status: Deselected |