# קבע את מפתחות ה-API ל-Google Gemini

**URL:** https://meta.discourse.org/t/configure-api-keys-for-google-gemini/289556
**Category:** Integrations
**Tags:** deprecation, how-to, ai
**Created:** [22 בדצמבר,‏ 2023,‏ 4:52pm UTC](https://meta.discourse.org/t/configure-api-keys-for-google-gemini/289556 "2023-12-22T16:52:36Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [22 בדצמבר,‏ 2023,‏ 4:52pm UTC](https://meta.discourse.org/t/configure-api-keys-for-google-gemini/289556/1 "2023-12-22T16:52:36Z")

</div>

> 🔖 This guide explains how to configure API keys for Google Gemini to enable Discourse AI features that require 3rd party LLM keys.
> 
> 🙋 Required user level: Administrator

## Google Gemini

In this example, we are using Google Gemini to generate the keys.

> ℹ In order to use certain AI feature, users must have an API Key from a 3rd party provider such as OpenAI (ChatGPT), Anthropic (Claude), Stability AI (Stable Diffusion), etc.
> 
> Please check each AI feature to see which 3rd party providers can be used for it.

> **Note** : Please see here for up-to-date[details and pricing](https://ai.google.dev/pricing).

> 🥳 [AI Bot](https://meta.discourse.org/t/discourse-ai-ai-bot/266012) can now use [Gemini 1.5 Pro](https://deepmind.google/technologies/gemini/pro/) while [Gemini Flash](https://deepmind.google/technologies/gemini/flash/) is supported for [Summarization](https://meta.discourse.org/t/discourse-ai-summarization/262711)

Platforms will always change so this guide may not reflect 100% process.

### Generate the API key

1. Log in to Google AI Studio. Follow the instructions in [their documentation](https://ai.google.dev/tutorials/setup) to get an API key
2. Generate the API Key
3. Once the key is generated, store it in a safe and secure place and copy it

 ![CleanShot 2023-12-22 at 11.56.04@2x](https://global.discourse-cdn.com/meta/original/4X/4/f/e/4fee23b1cabcccf562790281d590cc379edeb7b6.png)

### Using API key for Discourse AI

1. Go to `Admin` settings-\> `Plugins` → `AI` → `LLMs` tab
2. Click on the + New Model button.
3. Select the appropriate Gemini model from the list.

 ![LLM dropdown](https://global.discourse-cdn.com/meta/original/4X/d/8/e/d8ebc880feb676c3aec3a9b4dedf31395bcb302b.png)

1. Paste the API key into the `API Key of the service hosting the model` field.
2. Save the LLM.

 ![LLM configuration](https://global.discourse-cdn.com/meta/original/4X/4/4/b/44b7eae34dc20cfbd969c29d1b0da8a35df73bd2.png)

## Additional resources

- [Enable AI Bot](https://meta.discourse.org/t/enable-ai-bot/266012)
- [Discourse AI Summarization](https://meta.discourse.org/t/discourse-ai-summarization/262711)
- [Google AI Pricing](https://ai.google.dev/pricing)
- [Google Gemini 1.5 Pro](https://deepmind.google/technologies/gemini/pro/)
- [Google Gemini Flash](https://deepmind.google/technologies/gemini/flash/)

> Last edited by @Lilly 2024-08-08T08:11:35Z
> 
> > **Check document**
> >
> > Perform check on document:

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [27 בפברואר,‏ 2024,‏ 12:47pm UTC](https://meta.discourse.org/t/configure-api-keys-for-google-gemini/289556/2 "2024-02-27T12:47:32Z")

</div>

I’ve added the Google Gemini Api key in the Discourse settings (AI Plugin is working ok, at lease showing so). Also enabled the ‘Ai\_Bot’ in settings.

But am not feeling any change in my site anywhere. I was expecting that may be I’d be perhaps able to create auto caption for any picture I load in composer window. Or … see below:

 ![The image is a screenshot of a conversation in an online forum where a user named "Bathinda Helper" appears to be asking for assistance with the text "What do I do?" and another user named "gpt3.5_bot" is involved in the thread. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/2/e/2/2e2767826dabdf35188895a218b89dcd675fe254.png)

---

<div class="post-metadata">

### Author: ![Saif](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saif/32/318253_2.png) [@Saif](https://meta.discourse.org/u/Saif)
#### Post date: [28 בפברואר,‏ 2024,‏ 3:30am UTC](https://meta.discourse.org/t/configure-api-keys-for-google-gemini/289556/3 "2024-02-28T03:30:28Z")

</div>

> [@Bathinda](#):
>
> I’ve added the Google Gemini Api key in the Discourse settings (AI Plugin is working ok, at lease showing so). Also enabled the ‘Ai\_Bot’ in settings.
> 
> But am not feeling any change in my site anywhere. I was expecting that may be I’d be perhaps able to create auto caption for any picture I load in composer window. Or … see below:

Is the following configured accurately for [AI Bot](https://meta.discourse.org/t/enable-ai-bot/266012)?

> [@Discourse AI - AI bot](https://meta.discourse.org/t/discourse-ai-ai-bot/266012/1):
>
> - Go to `Admin` settings-\> `Plugins` → search or find `discourse-ai` and make sure its enabled
> - Checkmark `ai_bot_enabled` to enable AI Bot
> - Pick the group of users through `ai_bot_allowed_groups` to allow specific access to the AI Bot.
> - Select the Large Language Model (LLM) model you would like to use `ai_bot_enabled_chatbots`, by default its `GPT-3.5-turbo` but you can also pick `GPT-4` and/or `Claude-2`

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [28 בפברואר,‏ 2024,‏ 4:13am UTC](https://meta.discourse.org/t/configure-api-keys-for-google-gemini/289556/4 "2024-02-28T04:13:59Z")

</div>

Thanks @Saif  
I’m taking the hint that I should check this check list sent by you, and if any difficulty, I should better get involved myself under [that](https://meta.discourse.org/t/enable-ai-bot/266012) topic only.  
If I’m wrong in understanding this, Pls tell me and I’ll follow up here, under this topic only.

---

<div class="post-metadata">

### Author: ![Saif](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saif/32/318253_2.png) [@Saif](https://meta.discourse.org/u/Saif)
#### Post date: [28 בפברואר,‏ 2024,‏ 4:39pm UTC](https://meta.discourse.org/t/configure-api-keys-for-google-gemini/289556/5 "2024-02-28T16:39:13Z")

</div>

> [@Bathinda](#):
>
> I’m taking the hint that I should check this check list sent by you, and if any difficulty, I should better get involved myself under [that](https://meta.discourse.org/t/enable-ai-bot/266012) topic only.  
> If I’m wrong in understanding this, Pls tell me and I’ll follow up here, under this topic only.

Assuming the API key is working as intended then I would recommend checking with each of the configurations of the Discourse AI features you have enabled to ensure they are working appropriately.

Sure you can post in that topic

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [8 באוגוסט,‏ 2024,‏ 7:46am UTC](https://meta.discourse.org/t/configure-api-keys-for-google-gemini/289556/6 "2024-08-08T07:46:41Z")

</div>



---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [8 באוגוסט,‏ 2024,‏ 8:13am UTC](https://meta.discourse.org/t/configure-api-keys-for-google-gemini/289556/8 "2024-08-08T08:13:41Z")

</div>


