feat: Support custom ElevenLabs credentials in voice token endpoint #16
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
Extends the
/v1/voice/tokenendpoint to accept optional custom ElevenLabs credentials from the client, enabling bring-your-own voice agent support.Changes
customAgentIdandcustomApiKeyparameters to the voice token requestELEVENLABS_API_KEYandELEVENLABS_AGENT_IDenv vars)API Changes
POST /v1/voice/token
Request body (all fields optional):
{ "revenueCatPublicKey": "string", "customAgentId": "string", "customApiKey": "string" }When customAgentId and customApiKey are both provided, the server uses these credentials to fetch the conversation token from ElevenLabs. Otherwise, it uses the server's configured defaults.
Backward Compatibility
Fully backward compatible - existing clients that don't send custom credentials continue to work with server defaults.
Test plan
Note: The client and server PRs should be merged together or in sequence (server first, then client) since the client changes depend on the server supporting custom credentials.
Client PR: slopus/happy#258