Configure API Keys for Azure OpenAI

:bookmark: This guide explains how to configure API keys for Azure OpenAI to enable Discourse AI features that require 3rd party LLM keys.

:person_raising_hand: 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 .

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

:information_source: 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 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.
  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

Last edited by @pedro 2025-07-23T20:13:11Z

Check documentPerform check on document:
2 Likes