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
Supported SDK versions
Keep your SDK up to date. The latest release always includes the most complete API coverage.
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.
SPITCH_API_KEY = "YOUR_API_KEY"
Install or upgrade the SDKs
Python
Use either pip or uv pip.
# Fresh install
pip install spitch
# Upgrade an existing environment
pip install --upgrade spitch
TypeScript / JavaScript
Install or update the NPM package.
npm install spitch
# or upgrade in an existing project
npm install spitch@latest
Client Setup
The Spitch SDK provides both synchronous and asynchronous clients for Python, and async support for TypeScript:
Python (Async - Recommended)
Python (Sync)
TypeScript
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.
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 .