# पाठ से वाक्

**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` — प्रोडक्शन

## Authentication

- `FeloBearerAuth` (http bearer) — Felo API key, `Authorization: Bearer <key>` के रूप में भेजी जाती है।
- `FeloApiKey` (apiKey in header `X-API-Key`) — Felo API key, `X-API-Key: <key>` के रूप में भेजी जाती है।

## 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 — सफल उत्तर ऑडियो बाइट देता है: MP3 के लिए `audio/mpeg` या रॉ PCM के लिए `audio/pcm`, WAV, JSON या SSE नहीं। चलाने से पहले HTTP स्थिति और पूरा ट्रांसफ़र जाँचें। `--fail` HTTP त्रुटि को ऑडियो फ़ाइल में लिखने से रोकता है। कनेक्शन टूटने पर अधूरी फ़ाइल हटाएँ। PCM पैरामीटर चैनल से जाँचें, अनुमान न लगाएँ। STT में `input_audio_second` या token, TTS में `input_character` लागू है। `speech_billing_unit` में `utf16_code_unit` और `unicode_code_point` emoji अलग गिनते हैं। आरक्षण खर्च की सीमा नहीं; निपटान असिंक्रोनस हो सकता है। प्रमाण की कमी मुफ़्त होने का संकेत नहीं। दोनों API `X-Felo-Channel` लेते हैं और चुने चैनल में एक बार भेजते हैं। टाइमआउट या डिस्कनेक्ट के बाद SDK सहित स्वतः पुनः प्रयास बंद रखें। `X-Request-Id` और उपलब्ध `X-Generation-Id` सहेजें। Console Playground अभी ऑडियो का समर्थन नहीं करता। `configured_rates` स्थिर दर और सत्यापित उपयोग से; `upstream_cost` सत्यापित प्रदाता लागत तथा प्रकाशित मार्कअप और छूट से निपटान करता है।

**audio/mpeg**

Schema: string, (binary)

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

**audio/pcm**

Schema: string, (binary)

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