Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/neuphonic-ws-header-auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@livekit/agents-plugin-neuphonic': patch
---

Send Neuphonic WebSocket TTS API keys via header authentication instead of query parameters.
8 changes: 6 additions & 2 deletions plugins/neuphonic/src/tts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,12 @@ export class SynthesizeStream extends tts.SynthesizeStream {
}
};

const url = `wss://${API_BASE_URL}/speak/${getBaseLanguage(this.#opts.langCode)}?${getQueryParamString(this.#opts)}&api_key=${this.#opts.apiKey}`;
const ws = new WebSocket(url);
const url = `wss://${API_BASE_URL}/speak/${getBaseLanguage(this.#opts.langCode)}?${getQueryParamString(this.#opts)}`;
const ws = new WebSocket(url, {
headers: {
[AUTHORIZATION_HEADER]: this.#opts.apiKey!,
},
});

try {
await new Promise((resolve, reject) => {
Expand Down
Loading