Skip to content

Azure OpenAI

AzureOpenAIProvider in the Vercel.AI.Azure namespace creates the Azure OpenAI models that this port implements. The API reference lists every option: AzureOpenAIProvider.

Browse the upstream catalog of Azure OpenAI models and their pricing on the Vercel AI Gateway models page.

Kind Factory method Model ids in this port’s tests and docs
Speech SpeechModel mai-voice-2, tts-1, mai-voice-2-flash
Transcription TranscriptionModel mai-transcribe-2, mai-transcribe-1.5, whisper-1, MAI-Transcribe-2-Streaming, mai-transcribe-2-streaming

A model id in the table is one that the tests or docs use. It is not the complete list of ids the provider accepts. Pass any id that the provider documents. An id that links to the Vercel AI Gateway catalog has a Gateway slug listed there.

Transcription model:

var model = (ITranscriptionCaller)
AzureOpenAIProvider.Create().TranscriptionModel("mai-transcribe-2");
var result = await Transcribe.TranscribeAsync(
new TranscribeRequest
{
Model = model,
Audio = await File.ReadAllBytesAsync("audio.mp3"),
}
);
Console.WriteLine(result.Text);

snippet source | anchor

See the Providers guide for authentication and provider options.

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product