Skip to main content
Prefer to explore first? Every endpoint in the API reference ships with an interactive playground that runs against your live key, with no setup required.

Prerequisites

  • A Spitch account and an API key.
  • Python 3.9+, Node 18+, or any HTTP client.
  • About five minutes.

1 · Install the SDK

Install the official client for your language. You can also call the REST API directly with curl.
pip install spitch

2 · Set your API key

Store your key as an environment variable so it never lands in source control.
export SPITCH_API_KEY="your_api_key_here"
Treat your key like a password. Keys grant full access to your account, so never commit them or expose them in client-side code.

3 · Generate your first clip

Send some text and pick a voice, optionally setting a language, and Spitch streams back an audio file.
from spitch import Spitch

client = Spitch()  # reads SPITCH_API_KEY

with open("hello.wav", "wb") as f:
    response = client.speech.generate(
        text="Ẹ káàrọ̀. Welcome to Spitch.",
        language="yo",
        voice="sade",
    )
    f.write(response.read())

4 · Play it back

You now have hello.wav on disk. Open it in any player, or pipe it straight to your speakers.
afplay hello.wav
That’s it. You’ve generated your first clip. The same request works for any of the supported voices and languages by changing the voice and language codes.

Next steps

Choose a voice

Compare timbre, accent and style across the voice library.

Transcribe audio

Turn recordings into accurate text with punctuation and diacritics.

Translate text

Translate between English and other supported languages.

Manage keys

Create, rotate and revoke your API keys.