Skip to main content

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 typeConfig locationNotes
Built-in OpenAItts.openai with provider: openaiUses model, voice, base_url, credential ref, and response_format.
Named command providertts.providers.<name>.type: commandRuns a local command and registers the output audio.
Named OpenAI-compatible providertts.providers.<name>.type: openai or openai-compatibleSame fields as OpenAI under a named provider.
Chat audio providertts.providers.<name>.type: openai-chat-audioUses 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:

ArgumentMeaning
textRequired 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

StatusMeaning
blocked_unavailableTTS service or provider is unavailable.
blocked_invalidRequired text or session fields are invalid.
errorProvider synthesis failed.

For generated audio artifact management, see Artifacts.