# متن سے تقریر

**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 کلید جو `Authorization: Bearer <key>` کے طور پر بھیجی جاتی ہے۔
- `FeloApiKey` (apiKey in header `X-API-Key`) — Felo API کلید جو `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` یا ٹوکن، TTS میں `input_character` استعمال ہوتا ہے۔ `speech_billing_unit` کے `utf16_code_unit` اور `unicode_code_point` emoji مختلف گنتے ہیں۔ محفوظ رقم خرچ کی حد نہیں؛ تصفیہ غیر ہم وقت ہو سکتا ہے۔ ثبوت کی کمی مفت ہونے کا مطلب نہیں۔ دونوں API، `X-Felo-Channel` لیتے ہیں اور منتخب چینل پر ایک بار بھیجتے ہیں۔ timeout یا رابطہ ٹوٹنے کے بعد 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"
}
```
