---
title: "Connecting to an AI Model"
canonical: "https://wiki.yellowfinbi.com/space/yfcurrent/2205287/Connecting%20to%20an%20AI%20Model"
format: markdown
---
Yellowfin requires the Customer to provide a connection to an external AI-model. You will need to obtain the API key for your subscription and use that to set up the connection from Yellowfin. If you are using a model from OpenAI, <u>[click here](https://help.openai.com/en/articles/4936850-where-do-i-find-my-openai-api-key)</u> to learn more about obtaining your API key from Open AIs documentation. If you are using Google Gemini models, <u>[click here](https://ai.google.dev/gemini-api/docs/api-key)</u> to learn about obtaining your API key from Google’s documentation.

Note that clicking the above links will navigate you to the providers website.

To establish an external connection, the user must have the External Connections role function enabled in their role.  This role function is found under Administration and has CUD options - Create, Update and Delete - enabling the Administrator to decide which roles can create external connections, update them and delete them.

When upgrading Yellowfin from an older version, the External Connections role function will be set to On for any Roles where the Data Sources role function is also set to On.

Once you have your API key, you can set up the connection from Yellowfin as follows:

1. Select Admin Settings / Admin Console from the main menu.
2. Expand the External Connections section.
3. Click the Add button to configure a new connection.
4. Enter the required details and click Save. You can test your connection to make sure it is working before you click Save. Make sure that the Retain Context check box is clicked On if you are using AI-NLQ. This will ensure that any answers are in the context of previously asked questions in the current NLQ session - ensuring a more natural conversational flow.
5. Check the appropriate checkbox to mark the new connection as the AI NLQ Default Connection or the AI Insights Default Connection. Note: AI Insights is the technology that powers the “Tell Me About My Data” feature.
6. Use of AI functionality in Yellowfin is governed under Supplemental Terms. When setting up a new connection, the check box needs to be checked in order for the Save button to be enabled. Checking the checkbox implies acknowledgement of those terms. A link to the terms is contained on this popup, but you can also review them <u>[here](https://portal.yellowfinbi.com/documentation/public/ai-supplemental-terms)</u>.
  Note, clicking this check box will only enable the Save button once the connection has been Tested.
7. By default, Yellowfin will output all messages sent to AI models, and all responses received from AI models, to both the log files and to an audit table in the repository database. If you prefer not to retain this data, or local regulations require this, you can enable the No Retention option under Advanced Setting.

Notes on usage:

- OpenAI connections simply require the API key and a connection Nickname.
- If you edit a connection, you will be required to test the connection again prior to saving. If the connection is successful, the Test Connection button will turn green.
- Client Organisations will inherit and use connections from the  Default Org. Unique connections can be created within a Client Org. If you mark these as the default for any AI-feature, the Client Org connection will supersede the Default Org connection.
- Azure OpenAI connections require an API Version and  Azure Endpoint URL  ,in addition to the API key. Consult your Azure OpenAI documentation on how to obtain these.
- Anthropic Claude connections require an API Version in addition to the API key. Consult your Claude documentation on how to obtain these.