BobaBanana API
Docs / API / Speech & voice cloning

Voice cloning and text-to-speech API

POST /v1/speech speaks your text in a voice you choose: either a saved library voice ("@handle") or a new voice cloned from a 5 to 30 second recording you upload. The result is a WAV file. Use the same voice in videos to make lip-synced talking characters.

Request fields#

Field Type Required Description
text string, up to 600 chars yes What to say
voice "@handle" or a voice sample object yes The voice
voice_consent boolean with a sample Must be true to clone an uploaded voice
webhook_url, metadata, name no As for images

Voice samples#

A voice sample is an object with one of file_id, url or data, plus an optional transcript:

{"file_id": "file_voice123", "transcript": "The exact words spoken in the recording."}

A plain string also works: "file_voice123", an https:// URL or a data: URI.

What makes a good sample:

  1. 5 to 30 seconds of speech (2 to 60 seconds is accepted).
  2. One speaker only, no music, no background noise.
  3. Clear, natural delivery in the style you want to hear back.
  4. An exact transcript, if you have one. Without it, BobaBanana transcribes the sample first.

Accepted formats: WAV, MP3, M4A, OGG, FLAC, WEBM, AAC, OPUS, up to 60 MB. The upload response includes duration and quality warnings (too short, too quiet, distorted, noisy).

Example: clone a voice and speak#

# 1. upload the sample
curl https://bobabanana.com/api/v1/files -H "Authorization: Bearer $BOBABANANA_API_KEY" -F "file=@my-voice.wav"

# 2. speak new text in that voice
curl https://bobabanana.com/api/v1/speech \
  -H "Authorization: Bearer $BOBABANANA_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "text": "Thanks for joining us. The next episode drops on Friday.",
    "voice": {"file_id": "file_voice123", "transcript": "Hi, this is my normal speaking voice for the sample."},
    "voice_consent": true
  }'

Example: a saved library voice#

{"text": "Once upon a time, in a valley hidden by mist, there lived a clockmaker.", "voice": "@storyteller"}

List available voices with GET /v1/voices (assets).

Response#

When the job succeeds, output.speech.url is a WAV file:

{"id": "x_51aa", "type": "speech", "status": "succeeded", "output": {"speech": {"url": "https://bobabanana.com/api/v1/files/content/out/...wav?...", "content_type": "audio/wav"}}}

Responsible voice cloning#

Frequently asked questions#

How much audio do I need to clone a voice?#

5 to 30 seconds of clean speech from one person.

Do I have to provide a transcript?#

No, but it helps. Without one, the sample is transcribed automatically before speaking.

Which languages are supported?#

English works best. Speech in the sample's language is the most reliable.

Can I use the cloned voice in a video?#

Yes. Send the same voice with a script to POST /v1/videos for a lip-synced talking clip.

Last updated 2026-11-27 · View as Markdown