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

@supertone/supertone

v0.2.3

Published

TypeScript Client SDK for Supertone API Generated by Supertone.

Readme

Supertone TypeScript Library

LOGO

Summary

Supertone Public API: Supertone API is a RESTful API for using our state-of-the-art AI voice models.

SDK Installation

The SDK can be installed with either npm, pnpm, bun or yarn package managers.

NPM

npm add @supertone/supertone

PNPM

pnpm add @supertone/supertone

Bun

bun add @supertone/supertone

Yarn

yarn add @supertone/supertone zod

# Note that Yarn does not install peer dependencies automatically. You will need
# to install zod as shown above.

[!NOTE] This package is published with CommonJS and ES Modules (ESM) support.

Requirements

For supported JavaScript runtimes, please consult RUNTIMES.md.

SDK Example Usage

Example

import { Supertone } from "@supertone/supertone";

const supertone = new Supertone({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await supertone.textToSpeech.createSpeech({
    voiceId: "<id>",
    apiConvertTextToSpeechUsingCharacterRequest: {
      text: "<value>",
      language: "ja",
    },
  });

  console.log(result);
}

run();

Authentication

Per-Client Security Schemes

This SDK supports the following security scheme globally:

| Name | Type | Scheme | | -------- | ------ | ------- | | apiKey | apiKey | API key |

To authenticate with the API the apiKey parameter must be set when initializing the SDK client instance. For example:

import { Supertone } from "@supertone/supertone";

const supertone = new Supertone({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await supertone.textToSpeech.createSpeech({
    voiceId: "<id>",
    apiConvertTextToSpeechUsingCharacterRequest: {
      text: "<value>",
      language: "ja",
    },
  });

  console.log(result);
}

run();

Models

Supertone’s Text-to-Speech API provides multiple TTS models, each with different supported languages, available voice settings, and streaming capabilities.

Model Overview

| Model Name | Identifier | Streaming Support (stream_speech) | Voice Settings Support | | ----------------------- | --------------------- | ----------------------------------- | --------------------------------------------------------------------------------------------------------- | | SONA Speech 2 | sona_speech_2 | ❌ Not supported | Supports all Voice Settings except subharmonic_amplitude_control | | SONA Speech 2 Flash | sona_speech_2_flash | ❌ Not supported | Supports all Voice Settings except similarity, text_guidance, subharmonic_amplitude_control | | SONA Speech 1 | sona_speech_1 | ✅ Supported | Supports all Voice Settings | | Supertonic API 3 | supertonic_api_3 | ❌ Not supported | Supports only the speed setting (others are ignored) | | Supertonic API 1 | supertonic_api_1 | ❌ Not supported | Supports only the speed setting (others are ignored) |

[!NOTE] Streaming Support

Streaming TTS using the stream_speech endpoint is only available for the sona_speech_1 model.

Normalized Text Support

The normalized_text parameter is supported only with the sona_speech_2 and sona_speech_2_flash models.
It is ignored when used with other models.


Supported Languages by Model

[!NOTE] The set of supported input languages varies depending on the TTS model.

  • sona_speech_2

    • en, ko, ja, bg, cs, da, el, es, et, fi, hu, it, nl, pl, pt, ro,
      ar, de, fr, hi, id, ru, vi
  • sona_speech_2_flash

    • en, ko, ja, bg, cs, da, el, es, et, fi, hu, it, nl, pl, pt, ro,
      ar, de, fr, hi, id, ru, vi
  • sona_speech_1

    • en, ko, ja
  • supertonic_api_3

    • en, ko, ja, ar, bg, cs, da, de, el, es, et, fi, fr, hi, hr, hu,
      id, it, lt, lv, nl, pl, pt, ro, ru, sk, sl, sv, tr, uk, vi
  • supertonic_api_1

    • en, ko, ja, es, pt

Voice Settings (Optional)

Some TTS models support optional voice settings that allow fine control over output speech characteristics (e.g., speed, pitch, pitch variance).

[!NOTE] The available Voice Settings vary depending on the TTS model.

  • sona_speech_2

    • Supports all Voice Settings except subharmonic_amplitude_control.
  • sona_speech_2_flash

    • Supports all Voice Settings except similarity, text_guidance, subharmonic_amplitude_control.
  • sona_speech_1

    • Supports all available Voice Settings.
  • supertonic_api_3

    • Supports only the speed setting.
      All other settings will be ignored.
  • supertonic_api_1

    • Supports only the speed setting.
      All other settings will be ignored.

All Voice Settings are optional. When omitted, each model’s default values will be applied.

Error Handling

SupertoneError is the base class for all HTTP error responses. It has the following properties:

| Property | Type | Description | | ------------------- | ---------- | --------------------------------------------------------------------------------------- | | error.message | string | Error message | | error.statusCode | number | HTTP response status code eg 404 | | error.headers | Headers | HTTP response headers | | error.body | string | HTTP body. Can be empty string if no body is returned. | | error.rawResponse | Response | Raw HTTP response | | error.data$ | | Optional. Some errors may contain structured data. See Error Classes. |

Example

import { Supertone } from "@supertone/supertone";
import * as errors from "@supertone/supertone/models/errors";

const supertone = new Supertone({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  try {
    const result = await supertone.textToSpeech.createSpeech({
      voiceId: "<id>",
      apiConvertTextToSpeechUsingCharacterRequest: {
        text: "<value>",
        language: "ja",
      },
    });

    console.log(result);
  } catch (error) {
    // The base class for HTTP error responses
    if (error instanceof errors.SupertoneError) {
      console.log(error.message);
      console.log(error.statusCode);
      console.log(error.body);
      console.log(error.headers);

      // Depending on the method different errors may be thrown
      if (error instanceof errors.BadRequestErrorResponse) {
        console.log(error.data$.status); // string
        console.log(error.data$.message); // string
      }
    }
  }
}

run();

Error Classes

Primary error:

Network errors:

Inherit from SupertoneError:

* Check the method documentation to see if the error is applicable.

Additional Example Code

Additional example code can be found in the examples directory.