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

# TTS (texto para fala)

> Chame `/audio/speech` usando o SDK Ruby.

**Método**: `client.generate_speech(...)` ou `client.create_speech(...)`.

### Exemplo

```ruby theme={null}
require 'phaseo_sdk'

client = PhaseoSdk::Phaseo.new(api_key: ENV.fetch("PHASEO_API_KEY"))
audio = client.generate_speech(
  model: 'openai/gpt-4o-mini-tts',
  input: 'Hello world',
  voice: 'alloy',
  format: 'mp3'
)
```

### Parâmetros principais

* `model` (obrigatório): ID de um modelo compatível com TTS.
* `input` (obrigatório): Texto a ser sintetizado.
* `voice`: Predefinição de voz (depende do modelo; por exemplo, `alloy`).
* `format`: `mp3`, `wav`, `flac` etc.
* `speed`: Multiplicador da velocidade de reprodução (normalmente entre 0,25 e 4).

### Retorno

Áudio binário


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.