Skip to content

Cloud ASR Brick not working with OpenAI as provider #352

Description

@ProgrammingElectronics

Using the Overview example code from the Cloud ASR brick, I am getting errors when using Open AI as the CloudProvider. Brick is working fine with provider=CloudProvider.GOOGLE_SPEECH

To replicate, use example code provided in the Cloud ASR Overview Tab and an OpenAI key in the Brick configuration:

from arduino.app_bricks.cloud_asr import CloudASR
from arduino.app_utils import App

asr = CloudASR()

def stream_events():
    print("Say 'stop' to stop the transcription.")
    with asr.transcribe_stream(duration=120.0) as events:
        for event in events:
            print(f"{event.type}: {event.data}")
            if event.type == "text" and (event.data or "").strip().lower() == "stop":
                break

App.run(stream_events)

The error message I am getting:

2026-07-09 20:47:54.726 INFO - [MainThread] arduino.app_bricks.cloud_asr.providers.openai:  Connecting to realtime ASR endpoint: wss://api.openai.com/v1/realtime?model=gpt-realtime
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/arduino/app_bricks/cloud_asr/providers/openai.py", line 159, in recv
return self._format_event(message)
~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/arduino/app_bricks/cloud_asr/providers/openai.py", line 144, in _format_event

raise ASRProviderError(f"OpenAI error: {payload}")
arduino.app_bricks.cloud_asr.providers.types.ASRProviderError: OpenAI error: {'type': 'invalid_request_error', 'code': 'beta_api_shape_disabled', 'message': 'The Realtime Beta API is no longer supported. Please use /v1/realtime for the GA API.', 'param': None, 'event_id': None}

The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/python/main.py", line 7, in <module>
text = cloud_asr.transcribe()
File "/usr/local/lib/python3.13/site-packages/arduino/app_bricks/cloud_asr/cloud_asr.py", line 126, in transcribe
for resp in self._transcribe_stream(session):
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/arduino/app_bricks/cloud_asr/cloud_asr.py", line 323, in _transcribe_stream
raise msg
File "/usr/local/lib/python3.13/site-packages/arduino/app_bricks/cloud_asr/cloud_asr.py", line 280, in _recv
result = self._provider.recv()
File "/usr/local/lib/python3.13/site-packages/arduino/app_bricks/cloud_asr/providers/openai.py", line 161, in recv

raise ASRProviderError(f"Error processing message: {exc}") from exc
arduino.app_bricks.cloud_asr.providers.types.ASRProviderError: Error processing message: OpenAI error: {'type': 'invalid_request_error', 'code': 'beta_api_shape_disabled', 'message': 'The Realtime Beta API is no longer supported. Please use /v1/realtime for the GA API.', 'param': None, 'event_id': None}
exited with code 1

After a little digging, it appears the primary issue is in this file, which is using a beta version of the speech to text API:
ASR Brick

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions