> ## Documentation Index
> Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Smallest AI

> Add and configure Smallest AI (Waves) models in TrueFoundry's AI Gateway

### Adding Models

Add Smallest AI models to the AI Gateway and set up access in three steps.

<Steps>
  <Step title="Navigate to Smallest AI Models in AI Gateway">
    In the TrueFoundry dashboard, go to **AI Gateway** → **Models** and select **Smallest AI**.

    <Frame caption="Smallest AI models on the provider account">
      <img src="https://mintcdn.com/truefoundry/xnxwG9wbAPzCd_DD/images/smallest-ai-models.png?fit=max&auto=format&n=xnxwG9wbAPzCd_DD&q=85&s=b5fdc5cee200979f3f2983a295feffb7" alt="Smallest AI provider account showing smallest-tts and smallest-stt models" width="1492" height="179" data-path="images/smallest-ai-models.png" />
    </Frame>
  </Step>

  <Step title="Add Smallest AI Account Details">
    Click **Add Smallest AI Account**. Enter a unique account name and your Smallest AI **API Key**. Optionally add collaborators so other users or teams can use this account. See [Gateway access control](/docs/ai-gateway/gateway-access-control) for details.

    <Frame caption="Smallest AI account configuration form">
      <img src="https://mintcdn.com/truefoundry/xnxwG9wbAPzCd_DD/images/smallest-ai-account.png?fit=max&auto=format&n=xnxwG9wbAPzCd_DD&q=85&s=1b097f8209d89c2a6f72a92eb6a630fc" alt="Smallest AI account configuration form with fields for name, collaborators, API key, and models" width="1344" height="792" data-path="images/smallest-ai-account.png" />
    </Frame>
  </Step>

  <Step title="Add Models">
    Click **+ Add Model** and fill in the **Display name**, **Model ID**, and **Model type** (Text to Speech or Audio Transcription).

    <Frame caption="Add a Smallest AI model">
      <img src="https://mintcdn.com/truefoundry/xnxwG9wbAPzCd_DD/images/smallest-ai-add-model.png?fit=max&auto=format&n=xnxwG9wbAPzCd_DD&q=85&s=3e45a4b66b5e8c2c127a2a5e8bc11dfe" alt="Smallest AI Add Model form with Display name, Model ID, and Model Types fields" width="1300" height="410" data-path="images/smallest-ai-add-model.png" />
    </Frame>

    <Warning>
      For Smallest AI, the **Model ID** and **Display name** must be identical (e.g. `smallest-tts`, `smallest-stt`).
    </Warning>
  </Step>
</Steps>

### Inference

Once models are added, use the **Smallest AI native HTTP API** to call TTS and STT endpoints through the gateway. Requests are proxied to Smallest AI's Waves API under your provider account path.

### Supported APIs

Once your Smallest AI provider account is configured, the following API surfaces are available through the gateway. The table below summarizes each endpoint alongside platform feature support (tracing, cost tracking).

<Info>
  Legend:

  * **✅** Supported by Provider and Truefoundry
  * <Icon icon="circle-xmark" iconType="regular" color="red" /> Supported by Provider, but not by Truefoundry
  * <Icon icon="circle-minus" iconType="regular" /> Provider does not support this feature
</Info>

| API                               | Endpoint                                                      | Tracing | Cost Tracking                                               |
| --------------------------------- | ------------------------------------------------------------- | ------- | ----------------------------------------------------------- |
| [Text-to-Speech](#text-to-speech) | `/tts/{providerAccountName}/waves/v1/smallest-tts/get_speech` | **✅**   | <Icon icon="circle-xmark" iconType="regular" color="red" /> |
| [Speech-to-Text](#speech-to-text) | `/stt/{providerAccountName}/waves/v1/smallest-stt/get_text`   | **✅**   | <Icon icon="circle-xmark" iconType="regular" color="red" /> |

<AccordionGroup>
  <Accordion title="Text-to-Speech">
    Convert text into audio using Smallest AI's Waves TTS API. The gateway forwards your request to `waves/v1/smallest-tts/get_speech` under your provider account and streams back the raw audio bytes. Full docs: [Text-to-Speech](/docs/ai-gateway/text-to-speech).

    **Before you start:** Replace `{GATEWAY_BASE_URL}` with your gateway base URL ([how to find it](/docs/ai-gateway/quick-start#gateway-base-url)) and `{smallestAiProviderAccountName}` with the display name of your Smallest AI provider account.

    ```python Python lines theme={"dark"}
    import requests

    TFY_API_KEY = "your-truefoundry-api-key"
    BASE_URL = "{GATEWAY_BASE_URL}/tts/{smallestAiProviderAccountName}"

    response = requests.post(
        f"{BASE_URL}/waves/v1/smallest-tts/get_speech",
        headers={
            "Authorization": f"Bearer {TFY_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)")
    ```

    <Info>
      For the full list of voices, supported sample rates, languages, and output formats, refer to the [Smallest AI Waves TTS reference](https://waves-docs.smallest.ai/).
    </Info>
  </Accordion>

  <Accordion title="Speech-to-Text">
    Transcribe audio with Smallest AI's Waves STT API. The gateway forwards your request to `waves/v1/smallest-stt/get_text` under your provider account. You can pass a remote audio URL via the JSON body. Full docs: [Speech-to-Text](/docs/ai-gateway/audio-transcription).

    ```python Python lines theme={"dark"}
    import requests

    TFY_API_KEY = "your-truefoundry-api-key"
    BASE_URL = "{GATEWAY_BASE_URL}/stt/{smallestAiProviderAccountName}"

    response = requests.post(
        f"{BASE_URL}/waves/v1/smallest-stt/get_text",
        params={"language": "en"},
        headers={
            "Authorization": f"Bearer {TFY_API_KEY}",
            "Content-Type": "application/json",
        },
        json={
            "url": "https://github.com/smallest-inc/cookbook/raw/main/speech-to-text/getting-started/samples/audio.wav",
        },
        timeout=120,
    )

    result = response.json()
    print(result["transcription"])
    ```

    <Info>
      Smallest AI returns a JSON object containing the `transcription` field. Refer to the [Smallest AI Waves STT reference](https://waves-docs.smallest.ai/) for additional parameters and supported languages.
    </Info>
  </Accordion>
</AccordionGroup>

<Note>
  **Cost tracking:** Smallest AI usage is **not** metered by the gateway. Tracing and request logging continue to work as with any other provider — see [Metrics Dashboard](/docs/ai-gateway/analytics).
</Note>
