> For the complete documentation index, see [llms.txt](https://docs.mindmac.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mindmac.app/how-to.../add-api-key/create-azure-openai-api-key.md).

# Create Azure OpenAI API Key

### Step 1: Create Azure OpenAI resource

Go to <https://portal.azure.com/#home>, and click **Create a resource**.

<figure><img src="/files/1G2fkW3O3KlwNb3BJpLB" alt=""><figcaption></figcaption></figure>

Search for **Azure OpenAI** and select it.

<figure><img src="/files/4f4nBTCEFkH44jXm89h6" alt=""><figcaption></figcaption></figure>

Select plan and click **Create**.

<figure><img src="/files/RMwqsZKdmaZO3LeC92xi" alt=""><figcaption></figcaption></figure>

Enter below information and click **Next**.

<figure><img src="/files/u6ZZqxH8qYuz3B7uu3xd" alt=""><figcaption></figcaption></figure>

Configure your network preference and click **Next**.

<figure><img src="/files/11fd305XP8vzwzfn6Gio" alt=""><figcaption></figcaption></figure>

Click **Next**.

<figure><img src="/files/a3k81osJ9XxHwcOBGqCy" alt=""><figcaption></figcaption></figure>

Review and click **Create**.

<figure><img src="/files/hEfo5kMZ1HoqD9VWvMrd" alt=""><figcaption></figcaption></figure>

It may take some minutes to deploy new resource.&#x20;

### Step 2: Grab API key, location & endpoint URL

When the resource has been deployed successfully, go back to <https://portal.azure.com/#home> and click on that resource.

<figure><img src="/files/OFJemRCSXSmDDI5aJZl1" alt=""><figcaption></figcaption></figure>

On tab **Overview**, copy key, location/region and endpoint URL. You will need them later.

<figure><img src="/files/ToUDmC8CLjTVvMkRmNk7" alt=""><figcaption></figcaption></figure>

### Step 3: Create new deployment

Switch to tab **Model deployments** and click **Manage Deployments**. You will be redirect to Azure OpenAI Studio.

<figure><img src="/files/ANbd94bQent3XbMIomD1" alt=""><figcaption></figcaption></figure>

Click **Create new deployments**.

<figure><img src="/files/LDuJpdCzbuV6jpzOZUx1" alt=""><figcaption></figcaption></figure>

Enter deployment model information and click **Create**. It may take some minutes to start a deployment.

<figure><img src="/files/DZJ4G2oOogdnhccfxCCV" alt=""><figcaption></figcaption></figure>

Copy the deployment name.

<figure><img src="/files/UoJ4zbVVnNivVv9FsQCp" alt=""><figcaption></figcaption></figure>

### Step 4: Construct full endpoint URL

Full endpoint URL has this format:&#x20;

> {your-endpoint}/openai/deployments/{deployment-id}/chat/completions?api-version={api-version}

where:

* your-endpoint: is the endpoint copied from [#step-2-grab-api-key-location-and-endpoint-url](#step-2-grab-api-key-location-and-endpoint-url "mention")&#x20;
* deployment-id: deployment name from [#step-3-create-new-deployment](#step-3-create-new-deployment "mention")
* api-version: use 2023-05-15 for now

For example: <https://mindmac.openai.azure.com/openai/deployments/mindmac-gpt-35-turbo/chat/completions?api-version=2023-05-15>.

Now use this full URL and the key from [#step-2-grab-api-key-location-and-endpoint-url](#step-2-grab-api-key-location-and-endpoint-url "mention") to create new API endpoint in MindMac. More details at [Add API key](/how-to.../add-api-key.md).
