Skip to main content
Learn how to set up a local development environment on your system to use Spitch API. We currently support:
  • Python - Both synchronous and asynchronous clients
  • TypeScript/JavaScript - Modern async/await support

Accessing your API Key

Log on to the developer portal to create your API Key. You can store your API Key in a .env file, or use it directly in your code.
.env
SPITCH_API_KEY = "YOUR_API_KEY"

Installation

Python
pip install spitch

Client Setup

The Spitch SDK provides both synchronous and asynchronous clients for Python, and async support for TypeScript:
Python (Async - Recommended)
from spitch import AsyncSpitch

# Using environment variable (recommended)
client = AsyncSpitch()  # automatically reads SPITCH_API_KEY

# Or pass API key directly
client = AsyncSpitch(api_key="YOUR_API_KEY")

Usage Example

Test your installation by running the sample code below for text translation.
Python
from spitch import AsyncSpitch
import asyncio

async def translate_text():
    client = AsyncSpitch()
    translation = await client.text.translate(
        text="Hey my dear friend, how are you doing?",
        source="en",
        target="ha",
    )
    print(translation.text)

# Run the example
asyncio.run(translate_text())

API Reference

For full details on all available methods and options, check out the API Reference.