# API-sleutels configureren voor Azure OpenAI

**URL:** https://meta.discourse.org/t/configure-api-keys-for-azure-openai/282442
**Category:** Integrations
**Tags:** how-to, ai
**Created:** [16 oktober 2023 om 20:05 UTC](https://meta.discourse.org/t/configure-api-keys-for-azure-openai/282442 "2023-10-16T20:05:26Z")
**Posts on this page:** 1
**Showing post:** 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: [16 oktober 2023 om 20:05 UTC](https://meta.discourse.org/t/configure-api-keys-for-azure-openai/282442/1 "2023-10-16T20:05:27Z")

</div>

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

In this example, we are using Azure OpenAI to generate the keys.

> **Note** : You will likely need a paid plan and have to pay per usage. See here for up-to-date [details and pricing](https://azure.microsoft.com/en-ca/products/ai-services/openai-service).

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

> ℹ In order to use certain AI modules, 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 module to see which 3rd party providers can be used for it.

## Obtain API keys

1. Go through the [documentation here](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models) to obtain the necessary API keys depending on the OpenAI models you choose and the Discourse AI modules/features you use
2. Once the keys are obtained, store them in a safe and secure place and copy it

## Add a Credential

API keys are managed centrally through the **Credentials** page. You must create a credential before configuring your LLM.

1. Go to `Admin` → `Plugins` → `AI` → `Credentials`
2. Click New credential
3. Give it a descriptive name (e.g. “Azure OpenAI API Key”)
4. Paste your Azure API key into the `Value` field
5. Save the credential

## Using API keys for Discourse AI

1. Go to `Admin` → `Plugins` → `AI` → `LLMs`
2. Click on the + New Model button.
3. Select the appropriate model from the list.  
 ![LLM list](https://global.discourse-cdn.com/meta/original/4X/4/a/f/4af01895babfe0751b863b4dd9cf6c8a34420d8c.png)
4. Select `Azure` from the `Provider` list
5. Input the `URL of the service hosting the model`

> Example URL: `https://{RESOURCE_NAME}.openai.azure.com/openai/deployments/{DEPLOYMENT_NAME}/chat/completions?api-version=2024-02-15-preview` where
> 
> - RESOURCE\_NAME is the name of your Azure OpenAI resource
> - DEPLOYMENT\_NAME is the name of your Azure OpenAI model deployment

1. Select the credential you created earlier from the credential dropdown
2. Save the LLM  
 ![Azure LLM configuration](https://global.discourse-cdn.com/meta/original/4X/7/3/3/7337ce94c294925dfe5abd24226f9d65c7b070a6.png)

> Last edited by @pedro 2025-07-23T20:13:11Z
> 
> > **Check document**
> >
> > Perform check on document:

---

_[View the full topic](https://meta.discourse.org/t/configure-api-keys-for-azure-openai/282442)._
