This quickstart documentation shows you how to quickly start integrating with the Spitch API using Python.

If Python isn’t your vibe, try using the ReST API directly. Go to the API Reference section. We’re working to add SDKs for more languages.

Get API Key

Go to https://dev.spi-tch.com to get your API Key. More info on API keys can be found on the Keys page.

Install the Python library

pip install spitch

More info on installation can be found on Installation

Sample Code (Python)

from spitch import Spitch

os.environ["SPITCH_API_KEY"] = "YOUR_API_KEY"
client = Spitch()

with open("audio.wav", "wb") as f:
    response = client.speech.generate(
        text="Báwo ni olólùfé?",
        language="yo",
        voice="femi"
    )
    f.write(response.read())

Congratulations!

You have now completed a task on speech generation. You are now equipped to start calling the Spitch models. Cool, right?