# লেখা থেকে কথা

**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) — `Authorization: Bearer <key>` হিসেবে পাঠানো Felo API key।
- `FeloApiKey` (apiKey in header `X-API-Key`) — `X-API-Key: <key>` হিসেবে পাঠানো Felo API 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 ভিন্নভাবে গোনে। সংরক্ষিত অর্থ ব্যয়ের সীমা নয়; নিষ্পত্তি অসিঙ্ক্রোনাস হতে পারে। প্রমাণ না থাকলে বিনামূল্য বোঝায় না। দুটিই `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"
}
```
