WebInfer

🔷

Azure OpenAI

Azure-hosted OpenAI models

Flagship
Major Cloud Provider
API

Configure Azure OpenAI

Add your Azure OpenAI API key in Settings

Go to Settings
Capabilities
chat
completion
embeddings
enterprise
Configuration Schema
Required and optional fields for configuring this provider
FieldTypeRequired
apiKey
password
Required
resourceName
text
Required
CLI Usage
For users running the daemon server locally or a self-hosted gateway

Add provider:

npx webinfer provider add azure --key YOUR_API_KEY

Test connection:

npx webinfer provider test azure

Get your API key from https://azure.microsoft.com/en-us/products/ai-services/openai-service

Programmatic Usage
Use Azure OpenAI in your code with WebInfer

Basic usage:

import { generateText } from "webinfer"

// WebInfer automatically routes to the best available provider
const result = await generateText({
  prompt: "Write a haiku about programming"
})

console.log(result.text)

Specify Azure OpenAI explicitly:

import { generateText } from "webinfer"

const result = await generateText({
  prompt: "Write a haiku about programming",
  provider: "azure"
})

console.log(result.text)
console.log("Provider:", result.provider)
console.log("Model:", result.model)

Streaming:

import { streamText } from "webinfer"

const { textStream } = await streamText({
  prompt: "Write a story about AI",
  provider: "azure"
})

for await (const chunk of textStream) {
  process.stdout.write(chunk)
}