We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The endpoint between Azure OpenAI Service (AOAI) and OpenAI API has a little bit different, but the API spec are the same.
Azure OpenAI Service
OpenAI API
Just change app/api/route.ts file from:
app/api/route.ts
const response = await fetch("https://api.openai.com/v1/chat/completions", { headers: { "Content-Type": "application/json", Authorization: `Bearer ${process.env.OPENAI_API_KEY}`, }, method: "POST", body: JSON.stringify({ model: "gpt-3.5-turbo-0125",
to
const response = await fetch(`https://${YOUR_RESOURCE_NAME}.openai.azure.com/openai/deployments/${YOUR_DEPLOYMENT_NAME}/chat/completions?api-version=2023-05-15`, { headers: { "Content-Type": "application/json", "api-key": `${process.env.OPENAI_API_KEY}`, }, method: "POST", body: JSON.stringify({ model: "gpt-35-turbo",
See also: Azure OpenAI Service REST API reference - Azure OpenAI | Microsoft Learn
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The endpoint between
Azure OpenAI Service
(AOAI) andOpenAI API
has a little bit different, but the API spec are the same.Just change
app/api/route.ts
file from:to
See also: Azure OpenAI Service REST API reference - Azure OpenAI | Microsoft Learn
The text was updated successfully, but these errors were encountered: