Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

e11

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

e11

fully typed js/ts openapi client for elevenlabs api

latest
npmnpm
Version
2023.9.2-3.1
Version published
Maintainers
1
Created
Source

elf ~ e11

fully typed js/ts openapi client for elevenlabs api

  • https://api.elevenlabs.io/docs
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))

FAQs

Package last updated on 23 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts