agentskit.js
Providers

azureOpenAI

Azure OpenAI — deployment-routed, api-version-pinned. Drop-in for enterprise Azure tenants.

import { azureOpenAI } from '@agentskit/adapters'

const adapter = azureOpenAI({
  apiKey: process.env.AZURE_OPENAI_API_KEY!,
  endpoint: 'https://my-resource.openai.azure.com',
  deployment: 'my-gpt4o-deployment',
  apiVersion: '2024-10-21',
})

Unlike the OpenAI adapter, Azure OpenAI routes by deployment name (not model id) and pins the REST API version in the query string. Auth is via the api-key header, not a Bearer token.

#Options

OptionTypeDefault
apiKeystringrequired
endpointstringrequired (e.g. https://my-resource.openai.azure.com)
deploymentstringrequired (Azure deployment name, not model id)
apiVersionstring2024-10-21
includeUsagebooleantrue
retryRetryOptionsinherited

#Capabilities

{ streaming: true, tools: true, usage: true } — request shape is OpenAI's chat completions schema; what's available depends on the deployment's underlying model.

#Env

VarPurpose
AZURE_OPENAI_API_KEYAPI key
AZURE_OPENAI_ENDPOINTResource endpoint

#Caveats

  • Azure deployments are bound to one model + one api-version contract — bumping the api-version is a deliberate change, not transparent. Pin it explicitly.
  • Some preview features (e.g. o1 reasoning) require preview api-versions; consult the Azure docs.

Explore nearby

✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page