npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

openai-fm-tts

v1.0.3

Published

A TypeScript module for generating Text-to-Speech audio via an unofficial, publicly accessible /generate route on https://www.openai.fm/. Supports customizable voices and vibes, with audio output in WAV or MP3 formats.

Readme

openai-fm-tts

A TypeScript module for generating Text-to-Speech (TTS) audio using an unofficial, publicly accessible /generate route on https://www.openai.fm/. This package allows customization of voices and vibes, with support for saving audio in WAV or MP3 formats.

Note: This module uses an undocumented API endpoint, which may not be officially supported or guaranteed to remain available.

Features

  • Generate TTS audio with customizable voices (e.g., Alloy, Nova, Shimmer).
  • Apply unique "vibes" (e.g., Pirate, Cyberpunk Hacker, Fairy Tale Narrator) to alter tone, emotion, and style.
  • Save audio output in WAV or MP3 formats using FFmpeg for MP3 conversion.
  • TypeScript support with comprehensive type definitions.
  • Modular design compatible with Bun and Node.js environments.

Installation

npm install openai-fm-tts

Ensure you have the following dependencies installed:

Usage

Generating TTS and Saving Audio

import { generateTTS, saveAudio, Voice, VibeList, vibes } from "openai-fm-tts";

const vibePerson = vibes[VibeList.SciFiCommander];

async function example() {
  try {
    const { audio, filename } = await generateTTS({
      input: "Welcome to the future!",
      voice: Voice.Echo,
      vibe: vibePerson.name,
    });
    const outputPath = await saveAudio({ audio, filename }, "output", "mp3");
    console.log(`Audio saved to: ${outputPath}`);
  } catch (error) {
    console.error("Error:", error);
  }
}

example();

API

generateTTS(request: GenerateRequest): Promise<GenerateResponse>

Generates TTS audio by sending a request to the /generate endpoint.

  • Parameters:
    • input: The text to convert to speech.
    • prompt: Optional custom prompt for additional context.
    • voice: Optional voice selection (defaults to Voice.Nova).
    • vibe: Optional vibe to apply (e.g., VibeList.Pirate).
  • Returns: A promise resolving to { audio: ArrayBuffer | Uint8Array, filename: string }.

saveAudio(response: GenerateResponse, outputPath: string, format: "wav" | "mp3"): Promise<string>

Saves the generated audio to a file.

  • Parameters:
    • response: The response from generateTTS.
    • outputPath: The desired file path (without extension).
    • format: The output format (wav or mp3).
  • Returns: A promise resolving to the saved file path.

Voices and Vibes

Voices

Available voices include: Alloy, Ash, Ballad, Coral, Echo, Fable, Onyx, Nova, Sage, Shimmer, Verse.

Vibes

Vibes add personality to the audio, such as:

  • Medieval Knight: Noble and heroic.
  • Pirate: Boisterous with seafaring charm.
  • Cyberpunk Hacker: Edgy and tech-savvy.
  • Fairy Tale Narrator: Whimsical and magical.
  • See VibeList enum for the full list.

Requirements

  • Node.js or Bun runtime.
  • FFmpeg installed for MP3 conversion.
  • TypeScript for development (optional but recommended).
  • tsup for building the project (required for the build script).

Building

npm run build

This compiles the TypeScript source to JavaScript in the dist/ directory and generates type declarations in the dist/index.d.ts file.

Disclaimer

This package relies on an unofficial API endpoint (/generate) from https://www.openai.fm/, which is publicly accessible but not documented. Usage of this endpoint may be subject to change or discontinuation without notice.

License

MIT