# GPT-4o Mini TTS + Voice Cloning

Model: **`gpt-4o-mini-tts`** (`TTS_MODEL`).

Interview **prompts stay text by default**. Use TTS only when the product needs spoken audio.

## Voice cloning (upload audio — do not select a builtin)

Manager cloning requires an **uploaded speaker sample** plus consent. Builtin names like `coral` are **not** used for cloning.

### On create / PATCH setup

`POST /api/v1/manager-clones` or `PATCH /api/v1/manager-clones/{clone_id}`

```json
{
  "company_id": "co-acme-001",
  "voice": {
    "voice_name": "Manager Voice",
    "sample_audio_base64": "<uploaded wav/mp3>",
    "consent_audio_base64": "<consent phrase recording>",
    "consent_language": "en",
    "sample_mime_type": "audio/wav"
  }
}
```

Or `sample_url` / existing `consent_id` instead of base64 fields.

### Via actions

`POST /api/v1/manager-clones/{clone_id}/actions`

```json
{
  "module": "voice",
  "action": "generate_voice",
  "input": {
    "voice_name": "Manager Voice",
    "sample_audio_base64": "<uploaded wav>",
    "consent_audio_base64": "<consent wav>",
    "consent_language": "en"
  }
}
```

Returns `voice_id` / `setup.voice.voice_id` for TTS.

## TTS (opt-in)

`POST /api/v1/tts/synthesize`

```json
{
  "text": "Welcome to your interview.",
  "voice_id": "<from clone setup / voice.generate_voice>",
  "instructions": "Speak clearly and professionally.",
  "response_format": "mp3"
}
```

Optional `"voice": "coral"` is only for **generic** TTS outside manager cloning.

## Env

See `.env.example` for `OPENAI_API_KEY` / `TTS_MODEL`.
