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

If Python and JavaScript aren’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://spitch.studio 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)"

import os
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())

"Install the Node package"

npm install spitch

More info on installation can be found on Installation

"Sample Code (JavaScript)"

import Spitch from 'spitch';

const client = new Spitch({ apiKey: process.env.SPITCH_API_KEY });

async function translate() {
  const response = await client.text.translate({
    text: "Hello, how are you?",
    source: "en",
    target: "yo"
  });
  console.log("Translated:", response.text);
}

translate();

Congratulations!

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