For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
ExamplesConsole
OverviewText to SpeechAPI ReferenceChangelog
OverviewText to SpeechAPI ReferenceChangelog
  • Get Started
    • Overview
    • Quickstart
    • Authentication
    • Models
    • API Limits
    • Official SDKs
  • Features
    • Voice Cloning
    • Language Support
    • Streaming
    • Emotion Control
    • SSML
    • Speech Marks
LogoLogo
ExamplesConsole
On this page
  • Python
  • TypeScript / JavaScript
  • REST API
  • Environment variables
Get Started

Official SDKs

Client libraries for Python and TypeScript
Was this page helpful?
Previous

Voice Cloning

Create custom voices from short audio samples
Next
Built with

Python

$pip install speechify-api
1from speechify import Speechify
2
3client = Speechify() # uses SPEECHIFY_API_KEY env var
4
5response = client.tts.audio.speech(
6 input="Hello from the Python SDK!",
7 voice_id="george",
8 audio_format="mp3",
9)
  • Requires Python 3.8+
  • Source code & docs
  • PyPI package

TypeScript / JavaScript

$npm install @speechify/api
1import { SpeechifyClient } from "@speechify/api";
2
3const client = new SpeechifyClient(); // uses SPEECHIFY_API_KEY env var
4
5const response = await client.tts.audio.speech({
6 input: "Hello from the TypeScript SDK!",
7 voiceId: "george",
8 audioFormat: "mp3",
9});
  • Works in Node.js and modern browsers
  • Source code & docs
  • NPM package

The old @speechify/api-sdk package is deprecated. See the changelog to upgrade.

REST API

No SDK needed — make direct HTTP calls from any language:

$curl -X POST https://api.speechify.ai/v1/audio/speech \
> -H "Authorization: Bearer $SPEECHIFY_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "input": "Hello from the REST API!",
> "voice_id": "george",
> "audio_format": "mp3"
> }'

See the API Reference for all available endpoints.

Environment variables

Both SDKs read the SPEECHIFY_API_KEY environment variable automatically:

$export SPEECHIFY_API_KEY="your-api-key-here"

You can also pass the key explicitly when creating the client. See the Authentication guide for security best practices.