Repository navigation
berd-call: read a separate OpenAI API key per service - #415
Closed
johnmatthewtennant wants to merge 1 commit into
Closed
johnmatthewtennant wants to merge 1 commit into
johnmatthewtennant wants to merge 1 commit into
Conversation
Realtime, speech to text and text to speech each read their own key (OPENAI_REALTIME_API_KEY, OPENAI_STT_API_KEY, OPENAI_TTS_API_KEY) and fall back to OPENAI_API_KEY when it is unset or blank. Error messages, public startup errors and the STT benchmark credential_source name the variable that applies. Signed-off-by: John Tennant <jtennant@block.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
🤖 Folded into #416 for review and merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Buzz Berd Call plugin is adding per-service OpenAI endpoint settings (URL plus its own key for realtime, speech to text and text to speech).
berd-callread onlyOPENAI_API_KEYfor all three, so a per-service key could not be passed.Each service now reads its own variable and falls back to
OPENAI_API_KEYwhen it is unset or blank, so existing setups are unchanged:--realtime-urlOPENAI_REALTIME_API_KEY--stt-urlOPENAI_STT_API_KEY--tts-urlOPENAI_TTS_API_KEYberd_call::openai::openai_key(kind_var), replaces the four inlineOPENAI_API_KEYreads.openai_key_varreports which variable supplied the key.credential_sourcename the variable that applies. Missing-key messages still containOPENAI_API_KEY is required.Related issue
N/A. none found.
Testing
Unit tests in
openai.rscover a service key winning overOPENAI_API_KEY, fallback when the service key is unset, and fallback when it is blank. Before the change the winning-key test fails (left: Some(("OPENAI_API_KEY", "shared")),right: Some(("OPENAI_TTS_API_KEY", "tts"))); after it, it passes.End to end,
berd-call synthesize --tts-backend openai ... --allow-paid-openaiagainst a local server that logs theAuthorizationheader (OPENAI_BASE_URLpointed at it):OPENAI_API_KEY=shared-keyBearer shared-keyOPENAI_API_KEY=shared-key OPENAI_TTS_API_KEY=tts-keyBearer tts-keyOPENAI_API_KEY=shared-key OPENAI_TTS_API_KEY=(blank)Bearer shared-keyOPENAI_TTS_API_KEY or OPENAI_API_KEY is requiredThe realtime and STT paths share the same helper and are covered by the unit tests, not by a live connection. No UI change.
🤖 Generated with Claude Code