Official SDKs

Client libraries for Python and TypeScript

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)

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});

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

REST API

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

$curl -X POST https://api.sws.speechify.com/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.