I was getting the error:

Error invoking model response: ElevenLabs API request failed: Client error: `POST https://api.elevenlabs.io/v1/text-to-speech/` resulted in a `404 Not Found` response: {"detail":"Not Found"}

The root of this issue was that is was not able to pull a "voice_id", and the "voice" array key was blank. Just to get things working I added a hardcoded ID on these lines:

Line 239:
modules\contrib\elevenlabs\src\Plugin\AiProvider\ElevenlabsProvider.php

Line 184:
modules\contrib\elevenlabs\src\ElevenLabsApiService.php

Once those were added everything worked. I don't see anywhere to specifiy a "voice_id" and the code doesn't populate a default.

Issue fork elevenlabs-3542656

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

    1 hidden branch
  • 1.0.x Comparecompare

Comments

tbadaczewski created an issue. See original summary.

saurabhkanva’s picture

Status: Active » Needs review
StatusFileSize
new2.48 KB

Set a default voice id as '21m00Tcm4TlvDq8ikWAM' which default for elevanlabs.

paulsheldrake’s picture

Hello

Do you have a paid for account on ElevenLabs? It should be pulling all the voices that are setup in your profile on ElevenLabs

paulsheldrake’s picture

When creating the API key make sure it has access to the following:

  • Text to Speech
  • Speech to Text
  • Audio Isolation
  • Users
  • Voices
  • Models
  • History
paulsheldrake’s picture

Status: Needs review » Postponed (maintainer needs more info)
henk’s picture

Status: Postponed (maintainer needs more info) » Needs work
Issue tags: +#global-contribution-poland

I have same problem, API Key is proper but module didn't find /text-to-speech API url.

I see on documentation page that EU residence have different API link

wss://api.eu.residency.elevenlabs.io/v1/speech-to-text/realtime

https://elevenlabs.io/docs/api-reference/speech-to-text/v-1-speech-to-te...


 	ElevenLabs API request failed: Client error: `POST https://api.elevenlabs.io/v1/text-to-speech/` resulted in a `404 Not Found` response: {"detail":"Not Found"} 
henk’s picture

I test on key without restriction and different url for EU residency and still have 404. So it is not URL.

I will debug it more.

andrewtur’s picture

Hi, i'm having the same issue. The voice_id can't be set since there is no Form for it.
Also im getting php errors like:

Warning: Undefined array key 1 in Drupal\elevenlabs\Plugin\AiProvider\ElevenlabsProvider->textToSpeech() (Zeile 239 in /app/web/modules/contrib/elevenlabs/src/Plugin/AiProvider/ElevenlabsProvider.php)

Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated in Drupal\elevenlabs\Plugin\AiProvider\ElevenlabsProvider->textToSpeech() (Zeile 239 in /app/web/modules/contrib/elevenlabs/src/Plugin/AiProvider/ElevenlabsProvider.php)

Warning: Undefined array key "voice" in Drupal\elevenlabs\Plugin\AiProvider\ElevenlabsProvider->textToSpeech() (Zeile 239 in /app/web/modules/contrib/elevenlabs/src/Plugin/AiProvider/ElevenlabsProvider.php)

all these error just state that the voice has not been set.

When I hardcode a voice I currently get a "402 paid_plan_required" cause im on a Free Plan and ElevenLabs has restriced the use of API Calls for Free Users

andrewtur’s picture

@henk as far as i could tell this error

ElevenLabs API request failed: Client error: `POST https://api.elevenlabs.io/v1/text-to-speech/` resulted in a `404 Not Found` response: {"detail":"Not Found"} 

is a result of the missing voice_id since the url should be https://api.elevenlabs.io/v1/text-to-speech/:voice_id
see elevenlabs api documentation: https://elevenlabs.io/docs/api-reference/text-to-speech/convert

andrewtur’s picture

I could no longer apply the patch from #2 so I rerolled it with some minor changes.

henk’s picture

@andrewtur when I setup field automator like a "Base mode" and add {{ context }}, setup Eleven Multilingual v2 instead of Default text to speech, it starts working without patch.

Context settings

Text to speek settings

From my side it looks like it was configuration problem, some parameters was missing on default setup.

andrewtur’s picture

StatusFileSize
new65.37 KB

Hi @henk, i cant see any of those form fields in the SettingsForm under admin/config/system/eleven-labs-settings.
When I to a look at the settingsForm.php of the elevenlabs module there is also only the api key as a setting.
The voice Id field is the one I added in the patch.

I'm only using elevenlabs for text to speech and have not got the ai automator submodule installed.

henk’s picture

You need to install AI Automator module, then go to particular field settings e.g. File with Mp3 format and setup automator action for Text to speech.

andrewtur’s picture

Hello henk,
thank you for the replay. I was not playing on using the ai automator but rather using a custom implementaion using the tts module.
I beleive this module should allow the user to set up the configuration without having to use a extra module enable to access the setting.
Do you agree ?

andrewtur changed the visibility of the branch 1.0.x to hidden.

andrewtur changed the visibility of the branch 1.0.x to hidden.

andrewtur’s picture

henk’s picture

Agree, first impression about Drupal AI project and this integration with Elevenlabs, that is over complicated. But probably there are reason behind that. As I see it this module using architecture that is made by https://www.drupal.org/project/ai project. With benefits and downsides. Probably will be good to check before merge that your default config is working with field related config overriding in different place. We can choose multiple models and voices depend on use case on website, language selected etc.