API key for a project project deployed in Azure

OpenAI has great documentation for installing API Key locally. I just call the API using:

import OpenAI from "openai";
const openai = new OpenAI();

However, I’m deploying my project to Azure. How to use API Key to call the API when it’s deployed?

It’s called AzureOpenAI :slight_smile:

2 Likes

OpenAI’s API and Microsoft Azure OpenAI’s API both essentially use the same language model. The one provided directly by OpenAI is the OpenAI API, while the one provided by Microsoft is Microsoft Azure OpenAI.
It’s hard to say which one is better, but there probably isn’t a significant difference.
If you can use it, considering the support from Microsoft, using Microsoft Azure OpenAI could be one option.

Please refer to the URL above to check which one is more suitable for your use case.

2 Likes

Thanks. This is great!
Anywhere I can find node.js conversions (OpenAI API → Azure OpenAI API) too?

1 Like

It’s kinda difficult to navigate the micosoft docs for some reason, when you go between frameworks. You gotta leave the page and use google, it’s not super well organized.

1 Like

Update:

I just read (July 2024 but this may have been implemented earlier) that " Azure OpenAI requires registration and is currently only available to approved enterprise customers and partners. Customers who wish to use Azure OpenAI are required to submit a registration form."

In case people go looking.

Welcome to the community!

If we read this super closely

Azure OpenAI requires registration and is currently only available to approved enterprise customers and partners

(Azure OpenAI requires registration) and (is currently only available) to (approved (enterprise customers) and (partners))

You may become an approved partner simply by filling out the form :slight_smile:

There was always a registration process as far as I was aware. I’d encourage you to try filling it out, worst case they get back to you in 10 days with a rejection.

Yeah that means you have to use a work email.
So anyone trying to learn azure while between jobs is out of luck.

I just wanted people to understand what they would be trying to sign up for so they don’t waste time.