# 음성 합성

**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`은 오류 본문이 오디오 파일에 저장되지 않도록 합니다. 중단된 파일은 폐기하세요. 원시 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"
}
```
