dograh/api/services
developer603 8a4a2e25db
feat: allow overriding base URL of OpenAI STT and TTS (#377)
Mirrors the LLM treatment from #368 for the OpenAI STT and OpenAI TTS
providers. Users running OpenAI-compatible self-hosted services (vLLM,
Speaches, llama.cpp, custom proxies) can now point Dograh at them via
the OpenAI provider with `base_url`, instead of being forced onto the
Speaches provider as a workaround.

Changes:

* `registry.py` — add `base_url` field (default `https://api.openai.com/v1`)
  to `OpenAISTTConfiguration` and `OpenAITTSService`, identical in shape
  to the existing `OpenAILLMService.base_url` from #368.

* `service_factory.py` — in the OPENAI branches of `create_stt_service`
  and `create_tts_service`, lift `base_url` off the user config, run it
  through `_validate_runtime_service_url`, and forward it as a kwarg to
  `OpenAISTTService` / `OpenAITTSService` (both already accept it). Same
  pattern as the LLM branch.

* `test_user_configured_service_url_security.py` — adds four runtime
  validation tests covering private-IP rejection and localhost rejection
  in SaaS mode for both STT and TTS. Existing OSS-mode permissiveness
  is unchanged (DEPLOYMENT_MODE=oss skips the validator, as before).

No schema migration needed — Pydantic populates the default; existing
configurations without `base_url` continue to talk to api.openai.com.

`check_validity.py` requires no edits because the per-service validation
loop already iterates `("base_url", "endpoint")` via `getattr`, and the
`_check_openai_api_key` dispatcher already routes OPENAI providers
through the base_url-aware code path (introduced in #368) for STT and
TTS too.

Tests pass locally:

    pytest api/tests/test_user_configured_service_url_security.py
    23 passed in 4.80s   (19 existing + 4 new)

Co-authored-by: developer603 <developer603@users.noreply.github.com>
2026-06-02 12:06:58 +05:30
..
auth feat: add agent skills to review PR (#320) 2026-05-19 17:02:26 +05:30
campaign chore: return formatted transcript url 2026-05-26 13:24:12 +05:30
configuration feat: allow overriding base URL of OpenAI STT and TTS (#377) 2026-06-02 12:06:58 +05:30
filesystem chore: bump pipecat version and fix tests (#263) 2026-05-04 21:35:37 +05:30
gen_ai feat: allow overriding base URL of OpenAI models (#368) 2026-05-27 13:07:45 +05:30
gender Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
integrations fix timestamps in tuner accumelator (#335) 2026-05-21 07:43:50 +05:30
pipecat feat: allow overriding base URL of OpenAI STT and TTS (#377) 2026-06-02 12:06:58 +05:30
pricing Add Sarvam LLM, update Sarvam STT models, expose usage_info on run detail (#351) 2026-06-01 10:29:31 +05:30
reports chore: return formatted transcript url 2026-05-26 13:24:12 +05:30
telephony fix: store channel id in gathered context for ARI outbound 2026-05-29 17:07:58 +00:00
voice_prompting_guide feat: add mcp guides for various topic and stages for bot building (#380) 2026-05-31 16:07:32 +05:30
worker_sync feat: add worker sync events 2026-04-04 14:26:47 +05:30
workflow fix: support object and array parameters in custom HTTP tools (#373) 2026-06-02 11:35:38 +05:30
mps_service_key_client.py fix: fix service key validation in OSS (#371) 2026-05-28 08:09:35 +05:30
posthog_client.py feat: add posthog signup and signin events, enable backend posthog events for oss version (#249) 2026-04-24 12:02:52 +05:30
quota_service.py feat: enable FORCE_TURN_RELAY to diagnose turn connectivity for local deployment setups (#272) 2026-05-11 17:13:01 +05:30
storage.py chore: bump pipecat version and fix tests (#263) 2026-05-04 21:35:37 +05:30
tool_management.py feat: create tools using MCP 2026-05-31 16:50:44 +05:30