Text To Speech
Text to speech lets Anyy synthesize audio from text and deliver it as a scoped artifact and outbound audio attachment.
The model-visible tool is text_to_speech in the tts toolset. Provider, voice,
format, and limits come from user configuration, not tool arguments.
Configuration
Minimal OpenAI-compatible setup:
tts:
enabled: true
provider: openai
timeout_ms: 60000
max_chars: 4096
openai:
model: tts-1
voice: alloy
base_url: https://api.openai.com/v1
api_key_ref: env:OPENAI_API_KEY
response_format: mp3
voice:
auto_tts: false
When tts.enabled is omitted, TTS is considered enabled only if a provider is
configured. An empty tts.provider disables the service.
Provider Options
Supported provider paths:
| Provider type | Config location | Notes |
|---|---|---|
| Built-in OpenAI | tts.openai with provider: openai | Uses model, voice, base_url, credential ref, and response_format. |
| Named command provider | tts.providers.<name>.type: command | Runs a local command and registers the output audio. |
| Named OpenAI-compatible provider | tts.providers.<name>.type: openai or openai-compatible | Same fields as OpenAI under a named provider. |
| Chat audio provider | tts.providers.<name>.type: openai-chat-audio | Uses chat-audio synthesis options. |
Custom command providers can set command, args, cwd, env,
output_format, content_type, timeout_ms, and max_chars.
Secret refs in provider env values are resolved before launch.
Preview
The dashboard and RPC layer expose TTS preview operations when the gateway is running. Preview uses the same configured provider and voice path as the runtime tool.
If preview fails, check provider credentials and tts.provider before debugging
channel delivery.
Auto TTS
voice.auto_tts controls whether voice/audio conversations reply with speech by
default. Configuring a TTS provider does not automatically turn every response
into audio.
The text_to_speech tool can still be used explicitly when the tts toolset is
visible and the provider is configured.
Messaging Delivery
The tool accepts one argument:
| Argument | Meaning |
|---|---|
text | Required text to synthesize. Provider-specific character caps apply and over-long input is truncated. |
On success it returns JSON with artifact_ref, and may include artifact_id,
content_type, and filename.
Generated speech is saved through the artifact store. Compatible providers and channels can render it as a voice bubble; otherwise it is sent as a regular audio attachment.
Failure Modes
| Status | Meaning |
|---|---|
blocked_unavailable | TTS service or provider is unavailable. |
blocked_invalid | Required text or session fields are invalid. |
error | Provider synthesis failed. |
For generated audio artifact management, see Artifacts.