0.0
No release in over a year
Ruby client for elevenlabs.io
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

ElevenLabs Ruby client

This is a Ruby client for the ElevenLabs API.

Installation

Add this line to your application's Gemfile:

gem 'elevenlabs-ruby'

Usage

Grab your token from your ElevenLabs account and authenticate by configuring api_token:

ElevenLabs.configure do |config|
  config.api_key = "your_api_token"
end

Checkout their API docs for available endpoints.

client = ElevenLabs::Client.new(api_key: 'xxxxxxxxxx')
voices = client.get('voices')
voice_id = voices['voices'].first['voice_id']
speech = client.post("text-to-speech/#{voice_id}", { text: 'your text' }) # returns a binary string

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.