Share via

Microsoft Foundry Speech Playground shows "Connection error to Realtime service: Invalid response status"

Phil Nylund 0 Reputation points
2026-04-19T15:15:09.15+00:00

I had been using the "gpt-4o-realtime-preview" speech-to-speech model in the past months without issues.

However since a few days it stopped working, not just in my python project but even in the Microsoft Foundry > Speech Playground:

When I select "gpt-4o-realtime-preview" as Generative AI Model in the Microsoft Foundry > Speech Playground > it shows a red error at the top of the screen:

Failed to connect to the service Connection error to Realtime service: Invalid response status Trace ID : 5e51f0c8-5100-462f-b9f9-f972c3dbe18a

It was still working last week. I thought the shutdown date was 2026-05-07. Any ideas? Also wondering how to migrate my code to "gpt-realtime-1.5" (the automatic code generation feature in the playground doesn't update despite hitting "apply" and is stuck at "gpt-4o-realtime-preview" as shown below:

parser.add_argument(
        "--model",
        help="VoiceLive model to use",
        type=str,
        default=os.environ.get("VOICELIVE_MODEL", "gpt-4o-realtime-preview"),
    )

So I guess my question is: Where can I find a basic functioning code example for "gpt-realtime-1.5"?

Azure Speech in Foundry Tools
0 comments No comments

2 answers

Sort by: Most helpful
  1. SRILAKSHMI C 18,035 Reputation points Microsoft External Staff Moderator
    2026-04-25T11:23:36.8133333+00:00

    Hello @Phil Nylund,

    Thank you for reaching out. I understand how disruptive this is, especially since your Speech Playground and application were working previously.

    Based on what you've described, there are two likely factors at play:

    1. A temporary service-side issue affecting the Realtime backend, which is why the error is occurring even in the Azure AI Foundry Speech Playground.
    2. The ongoing transition from the legacy preview model (gpt-4o-realtime-preview) to the newer generally available Realtime model (gpt-realtime-1.5).

    Why You're Seeing This Error

    The error message Connection error to Realtime service: Invalid response status indicates that the Speech Playground is unable to establish a valid connection to the Realtime service. Since the same issue occurs directly in the Azure AI Foundry portal, this strongly suggests that the problem is not related to your local code or environment.

    While gpt-4o-realtime-preview remains available until its retirement date, it is now considered a legacy preview model. As Microsoft continues transitioning customers to the latest Realtime offering, some intermittent issues may occur with older preview deployments.

    Recommended Action: Migrate to gpt-realtime-1.5

    Microsoft recommends moving to the latest generally available Realtime model: gpt-realtime-1.5.

    This model provides:

    • Improved reliability and stability
    • Better voice quality
    • Enhanced instruction following
    • Long-term support compared to preview models

    1: Verify Your Deployment

    In the Azure portal:

    • Open your Azure OpenAI resource.
    • Confirm that you have deployed the gpt-realtime-1.5 model.
    • Verify that the deployment name exactly matches the name you reference in your application and in the Speech Playground.

    2: Refresh the Speech Playground

    If the Speech Playground still shows only gpt-4o-realtime-preview:

    • Clear your browser cache, or
    • Open the portal in an Incognito/InPrivate window.

    This forces the UI to refresh the available model list.

    If needed, sign out and sign back into Azure AI Foundry.

    3: Update Your Application

    Replace any references to:

    gpt-4o-realtime-preview
    

    with:

    gpt-realtime-1.5
    

    For example:

    parser.add_argument(
    

    4: Use the Correct Endpoint

    For the GA Realtime API:

    • Endpoint: /openai/v1
    • Do not include an api-version query parameter

    Also ensure:

    • Your endpoint URL matches your Azure OpenAI resource
    • Your API key or Microsoft Entra authentication is valid
    • Your deployment name is correct

    Example

    from azure.identity import DefaultAzureCredential
    

    If You Are Using WebSockets

    Update your session initialization payload to:

    {
    

    If the Playground Still Fails

    Please check the following:

    • Try again after some time, as this may be a transient backend issue.
    • Test in another supported Azure region, if available.
    • Review Azure Service Health for any active incidents affecting Azure OpenAI Realtime services.

    The issue is likely a combination of a temporary Realtime service issue and the transition away from the preview model.

    Your current code is likely fine.

    Migrating to gpt-realtime-1.5 is the recommended path forward.

    In most cases, updating the model name and refreshing the Playground resolves the issue.

    Please refer this

    Troubleshooting Connection Errors in Azure AI Foundry portal https://learn.microsoft.com/azure/foundry/agents/how-to/tools/azure-ai-speech#troubleshooting

    Use the GPT Realtime API for speech and audio (ai-foundry-portal) https://learn.microsoft.com/azure/foundry/openai/how-to/realtime-audio?wt.mc_id=knowledgesearch_inproduct_azure-cxp-community-insider#troubleshooting

    Resolving WebRTC API Connection Issues with Azure OpenAI https://learn.microsoft.com/azure/ai-services/openai/how-to/realtime-audio-websockets

    Azure Samples: aoai-realtime-audio-sdk (Python examples) https://github.com/Azure-Samples/aoai-realtime-audio-sdk/tree/main/python/samples

    I Hope this helps. Do let me know if you have any further queries.


    If this answers your query, please do click Accept Answer and Yes for was this answer helpful.

    Thank you!


  2. Q&A Assist
    2026-04-19T15:15:26.1866667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The gpt-4o-realtime-preview model is no longer the recommended option for new work. The current supported real-time models in Azure AI Foundry are:

    1. gpt-4o-realtime-preview (2024-12-17)
    2. gpt-4o-mini-realtime-preview (2024-12-17)
    3. gpt-realtime (2025-08-28)
    4. gpt-realtime-mini (2025-10-06)
    5. gpt-realtime-mini (2025-12-15)
    6. gpt-realtime-1.5 (2026-02-23)

    All of these use the Realtime API via the GA /openai/v1 endpoint and support up to 32,000 input tokens and 4,096 output tokens.

    The error in the Foundry Audio/Speech (Real-time audio) playground:

    Failed to connect to the service – Connection error to Realtime service: Invalid response status

    indicates a backend Realtime service issue, not a client-side configuration problem. Similar issues in Foundry/Agents and other services have been resolved by platform hotfixes without user changes. When this happens in the portal playground and was working previously, the resolution is typically:

    • Wait for the service-side fix to be deployed.
    • Then re-open the Foundry project → Playgrounds → Audio playground and re-select the deployment.

    For using gpt-realtime-1.5 in code, the key points from the Realtime API documentation are:

    • Use a Realtime model deployment name such as gpt-realtime-1.5.
    • Call the GA endpoint with /openai/v1 (no date-based api-version).
    • Audio format must be:
      • PCM 16-bit (pcm16)
      • Mono
      • 24 kHz sample rate
    • For JSON transport, audio chunks must be base64-encoded and sent in small increments (about 100 ms per chunk).

    In the Python snippet shown, migration is conceptually as simple as changing the default model name to the new deployment, for example:

    parser.add_argument(
        "--model",
        help="VoiceLive model to use",
        type=str,
        default=os.environ.get("VOICELIVE_MODEL", "gpt-realtime-1.5"),
    )
    

    Then ensure the rest of the code:

    1. Connects to the Realtime API using the GA /openai/v1 endpoint.
    2. Streams microphone audio as 24 kHz mono PCM16 in small chunks.
    3. Handles WebSocket or WebRTC events according to the Realtime API (session events, audio in/out, etc.).

    If authentication or connection issues occur when switching models, use the documented troubleshooting steps:

    • For keyless (Microsoft Entra ID) auth, ensure AZURE_OPENAI_API_KEY is not set, run az login, and confirm the Cognitive Services OpenAI User role on the Azure OpenAI resource.
    • For connection errors:
      • Verify WebSocket/WebRTC endpoint URL and that port 443 is open.
      • For 401/403, validate key or Entra ID configuration and region support.
      • For 429, implement exponential backoff and check Realtime quotas.

    Because the Foundry Audio playground itself is failing with “Invalid response status” for gpt-4o-realtime-preview, this is almost certainly a platform-side issue rather than a problem in the local code. Once the service issue is resolved, updating the model name to gpt-realtime-1.5 and following the Realtime API requirements above will provide a working baseline.


    References:

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.