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

# Voice

> Text-to-speech and speech-to-text with the Pawa AI Python SDK.

Voice APIs live under `client.voice`. See the [Voice API reference](/api-reference/endpoint/voice/introduction).

## Text to speech

Returns raw audio bytes (typically MPEG):

```python theme={null}
from pawa_ai import PawaAI

client = PawaAI()

audio = client.voice.text_to_speech.create(
    model="pawa-tts-v1-20250704",
    text="Hello, this is Pawa AI speaking!",
    voice="liora",
)

with open("output.mp3", "wb") as f:
    f.write(audio)
```

Supported voices include `ame`, `liora`, and `ayana`.

## Speech to text

```python theme={null}
from pawa_ai import PawaAI

client = PawaAI()

response = client.voice.speech_to_text.create(
    files=["audio_file.wav"],
    model="pawa-stt-v1-20240701",
    language="sw",
    is_speaker_diarization=False,
)

print(response)
```

Optional parameters:

```python theme={null}
response = client.voice.speech_to_text.create(
    files=["meeting.wav"],
    model="pawa-stt-v1-20240701",
    language="en",
    is_speaker_diarization=True,
    prompt="Transcribe a product meeting.",
    temperature=0.0,
)
```

`client.voice.speech_to_text.transcribe(...)` is an alias for `create`.
