Home / Resources / Azure OpenAI GPT Realtime

Using Azure OpenAI GPT Realtime

Voice Nexus Service works with Microsoft Azure OpenAI GPT Realtime models in addition to the standard OpenAI API. This lets you run AI voice calls against an Azure-hosted model endpoint — useful when your organization requires data residency, enterprise agreements, or Microsoft cloud compliance.

How Azure Differs from Standard OpenAI

When you use a standard OpenAI account, your VNS CallStart response provides an openAIToken and VNS connects to OpenAI's shared API endpoint. With Microsoft Azure OpenAI, you instead provide a full aiUrl object that points to your own Azure-hosted resource.

Setting Standard OpenAI Azure OpenAI
Auth field openAIToken aiUrl.headers.api-key
Endpoint Managed by OpenAI wss://<resource>.services.ai.azure.com/…
Model selection openAIUrl (or default) ?model= query param in the URL
Billing OpenAI account Azure subscription

Prerequisites

Before configuring VNS, you need the following set up in Microsoft Azure:

  1. 1 An Azure subscription with access to Azure AI Foundry or Azure OpenAI Service.
  2. 2 An Azure AI Foundry project or Azure OpenAI resource created in a region that supports GPT Realtime models. Visit Microsoft AI Foundry to create one.
  3. 3 A deployed GPT Realtime model — go to Models + endpoints → Deploy base model in the Foundry portal and deploy a gpt-realtime variant.
  4. 4 Your resource's WebSocket endpoint URL and API key — both available from the Azure portal (see below).

Finding Your Endpoint and API Key

In the Microsoft AI Foundry portal, navigate to your project and open Models + endpoints. Select your deployed GPT Realtime model. The endpoint details panel shows the base URL and your API key.

VNS needs the WebSocket (wss://) form of the endpoint with the model appended as a query parameter. The format is:

wss://<your-resource>.services.ai.azure.com/openai/v1/realtime?model=<model-name>

For example, a resource named monroe-7384-resource using model gpt-realtime-1.5 would be:

wss://monroe-7384-resource.services.ai.azure.com/openai/v1/realtime?model=gpt-realtime-1.5
Two endpoint formats: Microsoft exposes GPT Realtime through both .openai.azure.com (legacy Azure OpenAI Service) and .services.ai.azure.com (Azure AI Foundry). Use whichever URL the portal shows for your specific resource — both work with VNS.

Getting Your API Key

From the same endpoint details panel, copy the Key value (a long alphanumeric string). This is passed in the api-key header — not as a Bearer token.

Keep your API key secret. Do not put it directly in your CallStart response code. Use a VNS API Key Substitution placeholder so the key stays inside the VNS portal and never appears in your configuration files.

CallStart Webhook Configuration

Use the aiUrl object in your CallStart response instead of openAIToken. The aiUrl.url is your Azure WebSocket endpoint and aiUrl.headers carries the api-key.

{
  "VoiceElements_Instructions": {
    "aiUrl": {
      "url": "wss://<your-resource>.services.ai.azure.com/openai/v1/realtime?model=gpt-realtime-1.5",
      "headers": {
        "api-key": "<<vns-api-token:YourAzureKeyName>>"
      }
    },
    "VoiceElements_Instructions": "You are a helpful AI voice assistant...",
    "maxSeconds": 300,
    "customerCallId": "{{sessionId}}"
  }
}

The <<vns-api-token:YourAzureKeyName>> syntax is a VNS placeholder — replace YourAzureKeyName with the profile name you gave the key when you stored it in the VNS portal. If you want to test quickly with a raw key, you can paste the key value directly — just remember to move it to a placeholder before going to production.

With a Raw Key (for Initial Testing)

{
  "VoiceElements_Instructions": {
    "aiUrl": {
      "url": "wss://monroe-7384-resource.services.ai.azure.com/openai/v1/realtime?model=gpt-realtime-1.5",
      "headers": {
        "api-key": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4"
      }
    },
    "VoiceElements_Instructions": "You are a helpful AI voice assistant.",
    "maxSeconds": 300
  }
}

Supported Models

VNS works with any GPT Realtime model that Microsoft Azure makes available. The model name goes in the ?model= query parameter of your endpoint URL. The following models are currently available for global deployments in Azure AI Foundry:

Model Notes
gpt-realtime-1.5 Latest — recommended for production
gpt-realtime Full-capability realtime model
gpt-realtime-mini Lower cost, faster response, lighter tasks
gpt-4o-realtime-preview Earlier preview model, still available
gpt-4o-mini-realtime-preview Earlier mini preview variant

Model availability varies by Azure region. Check the Microsoft Azure documentation for the current list of supported regions and model versions.

Troubleshooting

Call connects but AI doesn't respond

The WebSocket connection succeeded but the model session failed to initialize. Double-check that the model name in the ?model= query parameter exactly matches the deployment name in the Azure portal (they are case-sensitive).

401 / authentication error

The api-key header value is wrong or missing. Confirm the key is copied correctly from the Azure portal — it's a long alphanumeric string with no spaces. If using a VNS placeholder, verify the profile name in the VNS portal matches exactly.

Connection refused / WebSocket error

The endpoint URL is malformed or the model isn't deployed in that region. Verify the full wss:// URL is correct and that the model deployment is in an active state in the Azure portal (not throttled or failed).

Model not available in my region

GPT Realtime models are only available in certain Azure regions. If your existing resource is in an unsupported region, create a new Azure AI Foundry resource in a supported region (East US 2, Sweden Central, and West US 3 are commonly available). Check the Microsoft documentation for the current region list.

Ready to Automate Your Phone Lines?

See Voice Nexus in action. Book a live demo with our team and we'll walk you through setup, integrations, and pricing.