# Metinden konuşmaya

**API:** Model API

**Endpoint:** `POST /api/v1/audio/speech`

**Tags:** Audio

Use model to select the speech generation model. Channel selection is unavailable for speech generation requests.

## Base URL

- `https://openapi.felo.ai` — Üretim

## Authentication

- `FeloBearerAuth` (http bearer) — `Authorization: Bearer <key>` biçiminde gönderilen Felo API anahtarı.
- `FeloApiKey` (apiKey in header `X-API-Key`) — `X-API-Key: <key>` biçiminde gönderilen Felo API anahtarı.

## Request body

Required: **yes**

### application/json

Schema:

```json
{
  "type": "object",
  "required": [
    "model",
    "input"
  ],
  "additionalProperties": false,
  "properties": {
    "model": {
      "type": "string",
      "maxLength": 256
    },
    "input": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4096
    },
    "voice": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256,
      "description": "Optional non-blank voice ID. The upstream model determines whether a voice is required and which IDs it accepts. Catalog voices are examples."
    },
    "response_format": {
      "type": "string",
      "enum": [
        "pcm",
        "mp3"
      ],
      "default": "pcm"
    },
    "speed": {
      "type": "number",
      "default": 1,
      "description": "Currently only 1 is supported."
    }
  }
}
```

## Responses

### 200 — Başarı ses baytları döndürür: MP3 için `audio/mpeg`, ham PCM için `audio/pcm`; WAV, JSON veya SSE değil. Oynatmadan önce HTTP durumunu ve aktarımın tamamlandığını kontrol edin. `--fail`, HTTP hata gövdesinin ses dosyasına yazılmasını önler. Bağlantı kesilince eksik dosyayı atın. PCM parametrelerini kanaldan doğrulayın, tahmin etmeyin. STT `input_audio_second` veya token, TTS `input_character` kullanır. `speech_billing_unit` içindeki `utf16_code_unit` ve `unicode_code_point` emojileri farklı sayar. Rezervasyon harcama sınırı değildir; hesaplaşma asenkron olabilir. Eksik kanıt ücretsiz demek değildir. İki API de `X-Felo-Channel` alır ve seçilen kanala bir kez gönderir. Zaman aşımı veya kopma sonrası SDK dahil otomatik yeniden denemeyi kapatın; `X-Request-Id` ve varsa `X-Generation-Id` saklayın. Console Playground henüz sesi desteklemez. `configured_rates` sabitlenmiş fiyat ve doğrulanmış kullanımı; `upstream_cost` doğrulanmış sağlayıcı maliyetini yayımlanan ek ücret ve indirimle kullanır.

**audio/mpeg**

Schema: string, (binary)

```json
{
  "type": "string",
  "format": "binary"
}
```

**audio/pcm**

Schema: string, (binary)

```json
{
  "type": "string",
  "format": "binary"
}
```
