ElevenLabs

Auto-generated Elixir client for the ElevenLabs API.

Generated from the ElevenLabs OpenAPI spec by generate.exs.

Installation

Add eleven_labs to your list of dependencies in mix.exs:

def deps do
  [
    {:eleven_labs, "~> 0.1.0"}
  ]
end

Configuration

Set your API key in your application config:

config :eleven_labs, api_key: "your-xi-api-key"

Or pass it as an option to any function:

ElevenLabs.get_voices(api_key: "your-xi-api-key")

Usage

# List all voices
{:ok, response} = ElevenLabs.get_voices()

# Text-to-Speech (returns raw audio binary)
{:ok, response} = ElevenLabs.text_to_speech_full(
  "21m00Tcm4TlvDq8ikWAM",
  text: "Hello, world!"
)
File.write!("output.mp3", response.body)

# Add a voice (multipart file upload)
{:ok, response} = ElevenLabs.add_voice(
  name: "My Voice",
  files: ["sample1.wav", "sample2.wav"]
)

# Audio isolation
{:ok, response} = ElevenLabs.audio_isolation(audio: File.read!("input.mp3"))

Re-generating the client

mix run generate.exs

License

MIT