---
url: >-
  https://docs.corbitaltech.dev/products/ai-assistant-for-whatsmarks-saas/configure.md
description: >-
  Step-by-step guide to configure OpenAI and Google Gemini API for the AI
  Assistant & Knowledge Bot Addon.
---

# How to Configure AI Providers

This guide walks you through configuring **OpenAI** and **Google Gemini** (v1.1.0+) for your AI Assistant & Knowledge Bot Addon.

::: info Two separate settings pages

* **AI Integration** (Application Settings) — configures OpenAI for general WhatsMark chat features.
* **AI Assistant Settings** — configures the API key and provider used specifically by the AI Assistant module, including its own dedicated OpenAI key and Gemini support.
  :::

## Configure OpenAI

### Introduction

Before your AI Assistant can start responding to user queries, you need to configure the OpenAI API integration. This involves obtaining an API key from OpenAI and configuring it within your WhatsMark SaaS platform. The AI Assistant uses OpenAI's powerful language models to understand and respond to user queries based on your uploaded knowledge base.

## Step 1: Get Your OpenAI API Key

::: tip Modern Approach (2024+)
OpenAI now uses a project-based system for API keys. This guide follows the current recommended approach through Projects, which provides better organization and resource management.
:::

### 1. Create OpenAI Account

* Go to [OpenAI Platform](https://platform.openai.com/)
* Sign up for a new account or log in to your existing account
* Complete any required verification steps including phone verification

### 2. Create a New Project

#### Navigate to Projects

* Go to the [Projects page](https://platform.openai.com/settings/proj_default/general)
* Click **Create new project** from the left menu

#### Project Setup

* In the pop-up window, add your project name (e.g., "WhatsMark AI Assistant")
* Click **Create project**
* Note down the **Project ID** shown on the next page - you'll need this later

### 3. Configure Model Access

#### Set Model Permissions

* Ensure you're in the correct project (check the project name in the top navigation)
* Go to **Limits** from the left menu
* In the **Model usage** section, allow access to the models you plan to use:
  * `gpt-4` (for advanced reasoning, higher cost)
  * `gpt-4o-mini` (fast and cost-effective)
  * `gpt-5.4`

::: tip Best Practice
Only enable the models you actually plan to use. You can always add more models later as needed.
:::

### 4. Create API Key

#### Generate New Key

* Go to the [API Keys page](https://platform.openai.com/api-keys)
* Click **Create new secret key** button

#### Name Your Key

* Add a descriptive name for your API key (e.g., "WhatsMark-AI-Assistant-Production")
* This helps you identify the key's purpose later
* You can create multiple keys for different environments

#### Save Your Key Securely

* **Copy the generated API key immediately**
* Store it in a secure location (password manager recommended)
* **You cannot view the key again** after closing the dialog

::: warning Critical Security Notice

* Never share your API key publicly or commit it to version control
* Treat it like a password - keep it secure and private
* If compromised, immediately delete the key and create a new one
* Use descriptive names to easily manage multiple keys

:::

### 5. Set Up Billing (Required for Production)

#### Add Payment Method

* Go to **Settings** → **Billing** in your OpenAI account
* Add a valid payment method (credit/debit card)
* Set usage limits to control costs

## Step 2: Configure OpenAI in WhatsMark SaaS

### 1. Access Application Settings

* Log in to your WhatsMark SaaS admin dashboard
* In the left sidebar, navigate to **Settings** section
* Click on **Application Settings** from the menu

![OpenAI Configuration](Images/4.png)

### 2. Configure AI Integration

#### Activate OpenAI

* In the **AI Integration** section, you'll see the toggle for "Activate OpenAI in the chat"
* Turn on the toggle to enable OpenAI integration

#### Select Chat Model

* From the **Chat Model** dropdown, select your preferred model:
  * **GPT-4o Mini** (recommended for most use cases - cost-effective)
  * **GPT-4** (for advanced reasoning - higher cost)
  * Other available models as per your OpenAI project settings

#### Enter OpenAI Secret Key

* In the **OpenAI Secret Key** field, paste your API key from Step 1
* Ensure there are no extra spaces or characters
* The key should start with "sk-" followed by your unique identifier

#### Save Configuration

* Click the **Save Changes** button to apply your settings
* Verify that the configuration is saved successfully

## Next Steps

Once OpenAI is configured successfully, proceed to [How to Create AI Assistant](create-ai-assistant) to set up your knowledge base and train your AI assistant.

## Configure Gemini&#x20;

From version 1.1.0, you can use **Google Gemini** as the AI provider for your assistants. Gemini is configured separately in **AI Assistant Settings**, not in the main AI Integration page.

### Step 1: Get Your Gemini API Key

1. Go to [Google AI Studio](https://aistudio.google.com/)
2. Sign in with your Google account
3. Click **Get API key** → **Create API key**
4. Select or create a Google Cloud project
5. Copy the generated API key and store it securely

::: warning
Never share your Gemini API key publicly or commit it to version control. If compromised, revoke it immediately from Google AI Studio and generate a new one.
:::

### Step 2: Configure Gemini in AI Assistant Settings

1. Log in to your WhatsMark SaaS admin dashboard
2. Navigate to **Settings → AI Assistant Settings**
3. In the **Gemini Configuration** section, paste your **Gemini API Key**
4. Select a **Default Gemini Model** from the dropdown:
   * `gemini-2.5-flash` — fast and cost-effective, recommended for most use cases
   * `gemini-2.5-pro` — advanced reasoning, longer context
5. Click **Save Changes**

![Gemini configuration in AI Assistant Settings](Images/setting.png)

::: tip
Once saved, **Gemini** will appear as a provider option in the **Select Provider** dropdown when creating a new AI assistant.
:::

## AI Assistant Settings — OpenAI Configuration  {#ai-assistant-settings-openai-configuration}

The AI Assistant uses its **own dedicated OpenAI configuration**, set up directly in **Settings → AI Assistant Settings**. This is separate from the **AI Integration** key used by general WhatsMark chat features, so you can use a different OpenAI account, project key, or model for the AI Assistant module.

### Configure OpenAI for the AI Assistant

1. Log in to your WhatsMark SaaS admin dashboard
2. Navigate to **Settings → AI Assistant Settings**
3. In the **OpenAI** card, turn on the **Activate OpenAI in the assistant** toggle
4. Select a **Chat Model** from the dropdown (for example, **GPT-4o Mini**)
5. Paste your **OpenAI Secret Key** (it starts with `sk-`)
6. Click **Save Changes**

![OpenAI configuration in AI Assistant Settings](Images/setting.png)

::: tip
Enter the API key here exactly as copied from the [OpenAI API Keys](https://platform.openai.com/api-keys) page, with no extra spaces.
:::

See the [Release Notes](releases) for the full list of new features in this version.
