> ## Documentation Index
> Fetch the complete documentation index at: https://smallestai-ff1e543d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Generate your first speech audio in under 60 seconds with Lightning TTS.

## Step 1: Get Your API Key

In the [Smallest AI console](https://app.smallest.ai/dashboard), select **API Keys** from the left sidebar under **Developer**.

<Frame caption="Select API Keys under the Developer section in the sidebar">
  <img src="https://mintcdn.com/smallestai-ff1e543d/-Svbu0K2_h-Zx2IT/images/api-keys-sidebar-navigate.png?fit=max&auto=format&n=-Svbu0K2_h-Zx2IT&q=85&s=48dbf58e2f4479aa1bcb889e960b4f07" alt="Smallest AI dashboard with API Keys highlighted under Developer section in the left sidebar" width="3840" height="2160" data-path="images/api-keys-sidebar-navigate.png" />
</Frame>

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

<Frame caption="Click Create API Key and enter a name">
  <img src="https://mintcdn.com/smallestai-ff1e543d/-Svbu0K2_h-Zx2IT/images/api-keys-create-button.png?fit=max&auto=format&n=-Svbu0K2_h-Zx2IT&q=85&s=b9a615ed1b8b3ebc719f56c7350350ae" alt="API Keys page showing the Create API Key button" width="3840" height="2160" data-path="images/api-keys-create-button.png" />
</Frame>

<Frame caption="Enter a name for identification and confirm">
  <img src="https://mintcdn.com/smallestai-ff1e543d/-Svbu0K2_h-Zx2IT/images/api-keys-enter-name.png?fit=max&auto=format&n=-Svbu0K2_h-Zx2IT&q=85&s=5692dcb9fb71fa62b1a710e3291287b4" alt="Create New API Key dialog with API Name field and Create API Key button" width="3840" height="2160" data-path="images/api-keys-enter-name.png" />
</Frame>

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

<Frame caption="Copy the API key from the dashboard">
  <img src="https://mintcdn.com/smallestai-ff1e543d/-Svbu0K2_h-Zx2IT/images/api-keys-copy-key.png?fit=max&auto=format&n=-Svbu0K2_h-Zx2IT&q=85&s=c53ca214e7df382ed56c99a3ca5ec3eb" alt="API Keys dashboard showing the newly created key with copy icon highlighted" width="3840" height="2160" data-path="images/api-keys-copy-key.png" />
</Frame>

Export the key in your terminal:

```bash theme={null}
export SMALLEST_API_KEY="your-api-key-here"
```

<Tip>New to Smallest AI? [Sign up here](https://app.smallest.ai?utm_source=documentation\&utm_medium=text-to-speech) first.</Tip>

## Step 2: Hear Audio in 30 Seconds

Paste this in your terminal — no install required:

```bash theme={null}
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:

<video controls style={{ width: '100%', maxWidth: '500px', height: '54px' }}>
  <source src="https://mintcdn.com/smallestai-ff1e543d/__rdeLT6wbSp7Z7Q/audio/tts-sample-hello.wav?fit=max&auto=format&n=__rdeLT6wbSp7Z7Q&q=85&s=bdb0210e6e55870d289dd5709b56e062" type="audio/wav" data-path="audio/tts-sample-hello.wav" />
</video>

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

## Step 3: Build It Into Your App

<CodeGroup>
  ```bash cURL theme={null}
  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
  ```

  ```python Python theme={null}
  import os
  import requests

  API_KEY = os.environ["SMALLEST_API_KEY"]

  response = requests.post(
      "https://api.smallest.ai/waves/v1/lightning-v3.1/get_speech",
      headers={
          "Authorization": f"Bearer {API_KEY}",
          "Content-Type": "application/json",
      },
      json={
          "text": "Modern problems require modern solutions.",
          "voice_id": "magnus",
          "sample_rate": 24000,
          "speed": 1.0,
          "language": "en",
          "output_format": "wav",
      },
  )

  with open("output.wav", "wb") as f:
      f.write(response.content)
  print(f"Saved output.wav ({len(response.content):,} bytes)")
  ```

  ```javascript JavaScript theme={null}
  const fs = require("fs");

  const API_KEY = process.env.SMALLEST_API_KEY;

  const response = await fetch(
    "https://api.smallest.ai/waves/v1/lightning-v3.1/get_speech",
    {
      method: "POST",
      headers: {
        Authorization: `Bearer ${API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        text: "Modern problems require modern solutions.",
        voice_id: "magnus",
        sample_rate: 24000,
        speed: 1.0,
        language: "en",
        output_format: "wav",
      }),
    }
  );

  const buffer = Buffer.from(await response.arrayBuffer());
  fs.writeFileSync("output.wav", buffer);
  console.log(`Saved output.wav (${buffer.length} bytes)`);
  ```

  ```python Python SDK theme={null}
  from smallestai.waves import WavesClient

  client = WavesClient(api_key="YOUR_API_KEY")
  audio = client.synthesize(
      "Modern problems require modern solutions.",
      sample_rate=24000,
      speed=1.0,
  )
  with open("output.wav", "wb") as f:
      f.write(audio)
  ```
</CodeGroup>

## Step 4: Explore More

<CardGroup cols={2}>
  <Card title="Voices & Languages" icon="users" href="/v4.0.0/content/text-to-speech/get-voice-models-langs">
    Browse 80+ voices across English, Hindi, Spanish, and Tamil.
  </Card>

  <Card title="Streaming TTS" icon="broadcast-tower" href="/v4.0.0/content/text-to-speech/stream-tts">
    Real-time audio streaming via WebSocket for voice assistants.
  </Card>

  <Card title="Voice Cloning" icon="microphone" href="/v4.0.0/content/voice-cloning/types-of-clone">
    Clone any voice from just 5-15 seconds of audio.
  </Card>

  <Card title="Pronunciation Dicts" icon="spell-check" href="/v4.0.0/content/text-to-speech/pronunciation-dictionaries">
    Custom pronunciations for brand names and technical terms.
  </Card>
</CardGroup>

## Key Parameters

| Parameter       | Type   | Default    | Description                                      |
| --------------- | ------ | ---------- | ------------------------------------------------ |
| `text`          | string | *required* | Text to synthesize (max \~250 chars recommended) |
| `voice_id`      | string | *required* | Voice to use (e.g., `magnus`, `olivia`)          |
| `sample_rate`   | int    | `44100`    | `8000`, `16000`, `24000`, or `44100` Hz          |
| `speed`         | float  | `1.0`      | Speech rate: `0.5` to `2.0`                      |
| `language`      | string | `auto`     | `en`, `hi`, `es`, `ta`, or `auto`                |
| `output_format` | string | `pcm`      | `pcm`, `wav`, `mp3`, or `mulaw`                  |

## Need Help?

<Card title="Join the Community" icon="discord" href="https://discord.gg/9WtSXv26WE">
  Ask questions, share what you're building, and connect with other developers on Discord.
</Card>

If you need direct assistance, reach out at [support@smallest.ai](mailto:support@smallest.ai).
