From 0e0d76d02046525c6a9ccc2b7cf21951001e74f9 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Fri, 15 May 2026 15:02:05 -0400 Subject: [PATCH 1/3] Update Gradium endpoints to region-neutral URLs Drop the EU-region default from the STT/TTS WebSocket URLs in favor of the generic api.gradium.ai endpoint, and remove the explicit overrides from the examples so they pick up the new defaults. --- examples/transcription/transcription-gradium.py | 1 - examples/update-settings/stt/stt-gradium.py | 5 +---- examples/update-settings/tts/tts-gradium.py | 1 - src/pipecat/services/gradium/stt.py | 4 ++-- src/pipecat/services/gradium/tts.py | 2 +- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/examples/transcription/transcription-gradium.py b/examples/transcription/transcription-gradium.py index 0b7a4412d..0fad1630b 100644 --- a/examples/transcription/transcription-gradium.py +++ b/examples/transcription/transcription-gradium.py @@ -51,7 +51,6 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): stt = GradiumSTTService( api_key=os.environ["GRADIUM_API_KEY"], - api_endpoint_base_url="wss://us.api.gradium.ai/api/speech/asr", settings=GradiumSTTService.Settings( language=Language.EN, delay_in_frames=8, diff --git a/examples/update-settings/stt/stt-gradium.py b/examples/update-settings/stt/stt-gradium.py index 876b20260..1cab2b9e1 100644 --- a/examples/update-settings/stt/stt-gradium.py +++ b/examples/update-settings/stt/stt-gradium.py @@ -50,10 +50,7 @@ transport_params = { async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): logger.info(f"Starting bot") - stt = GradiumSTTService( - api_key=os.environ["GRADIUM_API_KEY"], - api_endpoint_base_url="wss://us.api.gradium.ai/api/speech/asr", - ) + stt = GradiumSTTService(api_key=os.environ["GRADIUM_API_KEY"]) tts = CartesiaTTSService( api_key=os.environ["CARTESIA_API_KEY"], diff --git a/examples/update-settings/tts/tts-gradium.py b/examples/update-settings/tts/tts-gradium.py index 3750b004a..73ed1f1d0 100644 --- a/examples/update-settings/tts/tts-gradium.py +++ b/examples/update-settings/tts/tts-gradium.py @@ -55,7 +55,6 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): tts = GradiumTTSService( api_key=os.environ["GRADIUM_API_KEY"], settings=GradiumTTSService.Settings(voice="YTpq7expH9539ERJ"), - url="wss://us.api.gradium.ai/api/speech/tts", ) llm = OpenAILLMService( diff --git a/src/pipecat/services/gradium/stt.py b/src/pipecat/services/gradium/stt.py index 0e284d05b..3e5c954c2 100644 --- a/src/pipecat/services/gradium/stt.py +++ b/src/pipecat/services/gradium/stt.py @@ -150,7 +150,7 @@ class GradiumSTTService(WebsocketSTTService): self, *, api_key: str, - api_endpoint_base_url: str = "wss://eu.api.gradium.ai/api/speech/asr", + api_endpoint_base_url: str = "wss://api.gradium.ai/api/speech/asr", encoding: str = "pcm", sample_rate: int | None = None, params: InputParams | None = None, @@ -163,7 +163,7 @@ class GradiumSTTService(WebsocketSTTService): Args: api_key: Gradium API key for authentication. - api_endpoint_base_url: WebSocket endpoint URL. Defaults to Gradium's streaming endpoint. + api_endpoint_base_url: WebSocket endpoint URL. encoding: Base audio encoding type. One of "pcm", "wav", or "opus". For PCM, the sample rate is appended automatically from the pipeline's audio_in_sample_rate (e.g., "pcm" becomes "pcm_16000"). diff --git a/src/pipecat/services/gradium/tts.py b/src/pipecat/services/gradium/tts.py index 06b8c2743..ef6996643 100644 --- a/src/pipecat/services/gradium/tts.py +++ b/src/pipecat/services/gradium/tts.py @@ -68,7 +68,7 @@ class GradiumTTSService(WebsocketTTSService): *, api_key: str, voice_id: str | None = None, - url: str = "wss://eu.api.gradium.ai/api/speech/tts", + url: str = "wss://api.gradium.ai/api/speech/tts", model: str | None = None, json_config: str | None = None, params: InputParams | None = None, From 5403aa56e42d6f2118d1c35dda77ca96d946fba0 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Fri, 15 May 2026 15:17:12 -0400 Subject: [PATCH 2/3] Remove Gradium endpoint overrides from voice example Drop the explicit US-region URLs so the example picks up the new region-neutral defaults in GradiumSTTService and GradiumTTSService. --- examples/voice/voice-gradium.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/voice/voice-gradium.py b/examples/voice/voice-gradium.py index 89573f48a..e147d03e1 100644 --- a/examples/voice/voice-gradium.py +++ b/examples/voice/voice-gradium.py @@ -54,7 +54,6 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): stt = GradiumSTTService( api_key=os.environ["GRADIUM_API_KEY"], - api_endpoint_base_url="wss://us.api.gradium.ai/api/speech/asr", settings=GradiumSTTService.Settings( language=Language.EN, ), @@ -62,7 +61,6 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): tts = GradiumTTSService( api_key=os.environ["GRADIUM_API_KEY"], - url="wss://us.api.gradium.ai/api/speech/tts", settings=GradiumTTSService.Settings( voice="YTpq7expH9539ERJ", ), From 58a22aeeb16c86f7a054e07cff2fb512d074db47 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Fri, 15 May 2026 15:17:58 -0400 Subject: [PATCH 3/3] Add changelog for #4500 --- changelog/4500.changed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/4500.changed.md diff --git a/changelog/4500.changed.md b/changelog/4500.changed.md new file mode 100644 index 000000000..055eb9ade --- /dev/null +++ b/changelog/4500.changed.md @@ -0,0 +1 @@ +- Changed the default WebSocket endpoints for `GradiumSTTService` and `GradiumTTSService` to the region-neutral `wss://api.gradium.ai/api/speech/asr` and `wss://api.gradium.ai/api/speech/tts`. Gradium now automatically routes traffic to the nearest endpoint. Override the url to pin to a specific region.