Give your Voicebox voice a phone number
Landline.sh can play audio you choose on an outbound call or a voicemail greeting, instead of standard text-to-speech. This page covers the API. The same settings are in the dashboard under Calls, Numbers, and Voices. Back to API and MCP.
What it does
- Play a hosted MP3 on an outbound call with play_url.
- Play a greeting_url as a number's voicemail greeting.
- Or pick a hosted voice and pass it as voice_id: a Kokoro preset, a fast multilingual Piper preset, or a clone of your own voice made with consent. Landline renders your say or greeting text to MP3 in that voice and plays it.
How it works
Voicebox is open-source text-to-speech and voice cloning software under the MIT license. Presets use the Kokoro engine; clones use LuxTTS (Chatterbox Turbo if LuxTTS isn't available). Piper presets use Piper, open-source text-to-speech that runs fast on CPU, with voices whose datasets are CC0, CC BY 4.0, or public domain. Both run on a private host operated for Landline.sh. Landline calls it through a token-checked proxy, caches each rendered MP3 for your workspace, and gives Twilio a short-lived signed link to it. Your audio is never public, and other workspaces can't reach it: each link works for one render only and expires.
Landline never fetches play_url or greeting_url. Twilio fetches them when the call plays.
Steps
Set up your key once:
export LANDLINE_API_KEY='aph_...' # from your secret manager export LL=https://landline.sh/api/v1 auth=(-H "Authorization: Bearer $LANDLINE_API_KEY")
1. Create a preset voice. Presets are af_heart, af_bella, af_nicole, af_sarah, af_sky, am_adam, am_michael, bf_emma, bf_isabella, bm_george, and bm_lewis.
curl -s "${auth[@]}" -H 'content-type: application/json' $LL/voices \
-d '{"type":"preset","name":"Reminders","preset":"af_heart"}'
# => { "id": "VOICE_ID", "kind": "preset", "preset": "af_heart", "engine": "kokoro", "latency": "standard", "status": "ready", ... }For the lowest latency, or a language other than English, pick a Piper preset instead. Piper renders a sentence in about a third of a second once the voice is warm (about a second for the first render after a voice has been idle). Piper presets: piper:en_US-kathleen-medium and piper:en_US-joe-medium (US English), piper:en_GB-alba-medium and piper:en_GB-cori-medium (British English), piper:es_ES-davefx-medium (Spanish), piper:fr_FR-siwis-medium (French), piper:de_DE-thorsten-medium (German), piper:it_IT-paola-medium (Italian), piper:pt_BR-faber-medium (Brazilian Portuguese), and piper:ru_RU-denis-medium (Russian). GET /api/v1/voices returns them in catalog with engine: "piper" and latency: "fast".
curl -s "${auth[@]}" -H 'content-type: application/json' $LL/voices \
-d '{"type":"preset","name":"Fast reminders","preset":"piper:en_US-joe-medium"}'
# => { "id": "VOICE_ID", "kind": "preset", "preset": "piper:en_US-joe-medium", "engine": "piper", "latency": "fast", ... }Piper voices by the Open Home Foundation (rhasspy/piper-voices). Some are trained on or fine-tuned from CC BY 4.0 data: the Hi-Fi Multi-Speaker English TTS Dataset (NVIDIA), the SIWIS French Speech Synthesis Database, and the Alba Scottish English corpus (University of Edinburgh).
2. Or clone a voice. Clones are a multipart/form-data upload only; Landline doesn't fetch reference audio from a URL. Send one clean clip of one speaker and its exact transcript, with the consent fields. Without consent_attested=true, a consent_basis of own_voice or written_permission, and a consent_statement of 10-500 characters, the request returns 422 consent_required and nothing is sent to Voicebox.
curl -s "${auth[@]}" $LL/voices \
--form-string type=clone \
--form-string name='My voice' \
-F file=@my-voice.wav \
--form-string reference_text='Exactly what is said in the clip.' \
--form-string consent_attested=true \
--form-string consent_basis=own_voice \
--form-string consent_statement='This is my own voice, recorded by me for my workspace calls.'3. Place a call with say and voice_id:
curl -s "${auth[@]}" -H 'content-type: application/json' \
-H "Idempotency-Key: call-$(uuidgen)" $LL/calls \
-d '{"to":"+14155550123","say":"Hi, this is an automated reminder from Example Co.","voice_id":"VOICE_ID"}'4. Or place a call that plays your own file with play_url:
curl -s "${auth[@]}" -H 'content-type: application/json' \
-H "Idempotency-Key: call-$(uuidgen)" $LL/calls \
-d '{"to":"+14155550123","play_url":"https://example.com/reminder.mp3"}'A call has one media source. play_url can't be combined with say (play_url_say_exclusive) or voice_id (play_url_voice_id_exclusive), and voice_id needs say (voice_id_requires_say). Every other outbound gate still applies: consent, approval, allowlist, budget, and compliance.
5. Set voicemail with greeting and voice_id, or with greeting_url:
# Greeting text rendered in a hosted voice (the text is also the fallback)
curl -s "${auth[@]}" -X PUT -H 'content-type: application/json' $LL/numbers/NUMBER_ID/voicemail \
-d '{"greeting":"You reached Example Co. Leave a message after the beep.","voice_id":"VOICE_ID"}'
# Or your own recording
curl -s "${auth[@]}" -X PUT -H 'content-type: application/json' $LL/numbers/NUMBER_ID/voicemail \
-d '{"greeting":"You reached Example Co. Leave a message after the beep.","greeting_url":"https://example.com/greeting.mp3"}'With voicemail on, greeting or greeting_url is required. voice_id needs greeting and can't be combined with greeting_url. The greeting is rendered once when you save it. If that render is missing, the voice is deleted, or hosted voices are off, callers hear greeting_url if set, then the text greeting.
6. To hear a voice before you use it, or to host the audio yourself, render text without placing a call. The answer has a signed audio_url that works for one hour. Repeating the same text in the same voice returns the cached render (cached: true) and doesn't count against the render limit. It needs voices:write. A workspace keeps about 200 stored renders for previews; past that, previewing new text returns 422 voice_render_storage_full until you delete a voice you no longer use (its renders go with it).
curl -s "${auth[@]}" -H 'content-type: application/json' $LL/voices/VOICE_ID/renders \
-d '{"text":"Hi, this is an automated reminder from Example Co."}'
# => { "render_id": "...", "engine": "piper", "cached": false, "content_type": "audio/mpeg", "bytes": 27624,
# "audio_url": "https://landline.sh/api/v1/public/voice-audio/...?exp=...&sig=...", "expires_at": "...", "render_ms": 412 }List, read, and delete voices with GET /api/v1/voices, GET /api/v1/voices/:id, and DELETE /api/v1/voices/:id. Deleting a voice removes its cached audio. MCP has list_voices, get_voice, create_voice (Kokoro and Piper presets only), render_voice, and delete_voice, and place_call accepts play_url and voice_id.
Limits
- 20 voices per workspace (voice_limit_reached).
- Clips up to 5 MB (clip_too_large) and 30 seconds (clip_too_long; clip_duration_unknown if the length can't be read).
- Clip types: audio/mpeg, audio/wav, audio/wave, audio/x-wav, audio/mp4, audio/webm (clip_type_not_allowed).
- Text to render: up to 500 characters, the same cap as say and voicemail greetings.
- 10 new renders per minute per workspace (429 voice_render_rate_limited). Repeating the same text in the same voice uses the cache and doesn't count.
- play_url and greeting_url must be public HTTPS, up to 2048 characters. http, credentials in the URL, localhost, .local, metadata, and private or loopback addresses return 422 invalid_play_url or invalid_greeting_url.
Consent and the law
- Only clone your own voice, or a voice you have written permission from the speaker to clone and use on phone calls. Landline records who attested, when, and from which IP address, and keeps that record after the voice is deleted.
- The FCC's February 2024 Declaratory Ruling treats AI-generated voices in calls as an “artificial or prerecorded voice” under the TCPA. Outbound calls that use one need the called party's prior express consent, and prior express written consent for telemarketing. A recording you play with play_url is a prerecorded voice too.
- Don't impersonate other people or businesses.
- Landline.sh is not for one-time passcodes or verification bypass.
- This is not legal advice.
What's not supported
Live two-way conversations in a cloned voice are not supported. Hosted voices play one rendered message or greeting. Inbound AI voice agents use their own voice catalog.
When hosted voices are switched off
Landline operations can switch hosted voices off for the platform or for one workspace, without a deploy. While they are off, creating a voice or using voice_id returns 403 hosted_voices_disabled, signed audio links stop working, and voicemail falls back to the text greeting. play_url and greeting_url keep working, and you can still list and delete voices. GET /api/v1/voices reports the state as enabled.
Scopes
API keys need voices:read to list and read voices, and voices:write to create, render, and delete them. Neither carries a direct charge. calls:create remains the cost-bearing scope for calls, including calls that use a hosted voice. A key without the scope gets a missing_scope answer, and the workspace owner is asked to approve it.