Quickstart

View as Markdown

Step 1: Get Your API Key

In the Smallest AI console, select API Keys from the left sidebar under Developer.

Smallest AI dashboard with API Keys highlighted under Developer section in the left sidebar

Click Create API Key in the top-right corner, enter a name, and click Create API Key to confirm.

API Keys page showing the Create API Key button Create New API Key dialog with API Name field and Create API Key button

The new key appears in your dashboard. Click the copy icon to copy it.

API Keys dashboard showing the newly created key with copy icon highlighted

Export the key in your terminal:

$export SMALLEST_API_KEY="your-api-key-here"
New to Smallest AI? Sign up here first.

Step 2: Hear Audio in 30 Seconds

Paste this in your terminal — no install required:

$curl -X POST "https://api.smallest.ai/waves/v1/lightning-v3.1/get_speech" \
> -H "Authorization: Bearer $SMALLEST_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{"text": "Hello from Smallest AI. This is Lightning v3.1.", "voice_id": "magnus", "sample_rate": 24000, "output_format": "wav"}' \
> --output hello.wav

Play hello.wav — it should sound like this:

That’s broadcast-quality TTS with ~100ms latency.

Step 3: Build It Into Your App

$curl -X POST "https://api.smallest.ai/waves/v1/lightning-v3.1/get_speech" \
> -H "Authorization: Bearer $SMALLEST_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "text": "Modern problems require modern solutions.",
> "voice_id": "magnus",
> "sample_rate": 24000,
> "speed": 1.0,
> "language": "en",
> "output_format": "wav"
> }' --output output.wav

Full runnable source files: Python | JavaScript | cURL

Step 4: Explore More

Key Parameters

ParameterTypeDefaultDescription
textstringrequiredText to synthesize (max ~250 chars recommended)
voice_idstringrequiredVoice to use (e.g., magnus, olivia)
sample_rateint441008000, 16000, 24000, or 44100 Hz
speedfloat1.0Speech rate: 0.5 to 2.0
languagestringautoen, hi, es, ta, or auto
output_formatstringpcmpcm, wav, mp3, or mulaw

Need Help?

If you need direct assistance, reach out at support@smallest.ai.