README.md

# ElevenLabs

Auto-generated Elixir client for the [ElevenLabs API](https://elevenlabs.io).

Generated from the [ElevenLabs OpenAPI spec](https://api.elevenlabs.io/openapi.json) by `generate.exs`.

## Installation

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

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

## Configuration

Set your API key in your application config:

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

Or pass it as an option to any function:

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

## Usage

```elixir
# 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

```sh
mix run generate.exs
```

## License

MIT