e11
TypeScript icon, indicating that this package has built-in type declarations

2023.9.2-3.1 • Public • Published

elf ~ e11

fully typed js/ts openapi client for elevenlabs api

pnpm add e11
import { Configuration, TextToSpeechApi } from "e11"
import fs from "fs"

console.assert(process.env.SOME_SECRET)

const apiConfig = new Configuration({
  apiKey: process.env.SOME_SECRET,
})

const tts = new TextToSpeechApi(apiConfig)

const res = await tts.textToSpeechV1TextToSpeechVoiceIdPost(
  {
    voiceId: "21m00Tcm4TlvDq8ikWAM",
    bodyTextToSpeechV1TextToSpeechVoiceIdPost: {
      text: "helllo babeee",
      modelId: "eleven_multilingual_v2",
    },
  },
  {
    responseType: "arraybuffer",
  }
)

console.log(res.statusText)

fs.writeFileSync("output.mp3", Buffer.from(res.data))

Readme

Keywords

none

Package Sidebar

Install

npm i e11

Weekly Downloads

30

Version

2023.9.2-3.1

License

none

Unpacked Size

479 kB

Total Files

22

Last publish

Collaborators

  • devidw