# Apigator Audio APIs (agent-friendly): TTS, Music, Speech-to-Text

> Agent note: audio uses DIFFERENT endpoints than chat (audio in/out, not
> /v1/chat/completions). Same Apigator key, open to every key by default. Follow the
> exact endpoints, models, and the voice_id rule below; do not invent them.

Base host for chat + TTS: `https://api.apigator.ai/v1`. See
[/api.md](https://apigator.ai/api.md) for the general OpenAI-compatible API.

## Text-to-Speech (ElevenLabs)

Endpoint: `POST https://api.apigator.ai/v1/audio/speech`

```bash
curl https://api.apigator.ai/v1/audio/speech \
  -H "Authorization: Bearer sk-YOUR_APIGATOR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"elevenlabs-tts","input":"Hello from Apigator","voice":"21m00Tcm4TlvDq8ikWAM"}' \
  --output speech.mp3
```

- `model`: `elevenlabs-tts` (eleven_multilingual_v2) or `elevenlabs-tts-v3` (eleven_v3).
- IMPORTANT: `voice` MUST be an ElevenLabs voice id, NOT a name. A name like "Rachel"
  returns 500. Rachel's id is `21m00Tcm4TlvDq8ikWAM`. Get ids from ElevenLabs.
- Returns audio bytes (mp3). `voai-tts` is also available via the same endpoint.

## Music generation (ElevenLabs Music)

Endpoint: `POST https://litellm.mixerbox.ai/elevenlabs/v1/music`

```bash
curl https://litellm.mixerbox.ai/elevenlabs/v1/music \
  -H "Authorization: Bearer sk-YOUR_APIGATOR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"happy upbeat acoustic","music_length_ms":10000}' \
  --output music.mp3
```

- Returns audio bytes. Billed per minute of generated music.

## Speech-to-Text (AssemblyAI)

LiteLLM-native AssemblyAI passthrough:
`POST https://litellm.mixerbox.ai/assemblyai/v2/transcript` (upload + transcribe per
the AssemblyAI API). Authenticate with your Apigator key.

## Notes

- Pricing is not per-token (TTS ~ per character, Music ~ per minute); cost is tracked
  per use.
- A 500 on TTS almost always means a missing or invalid `voice` id.
- Image generation (Fal AI) uses `POST /v1/images/generations` with model e.g.
  `fal_ai/fal-ai/flux/schnell`. See [/api.md](https://apigator.ai/api.md).
