SAGEA LogoDocs & API
CookbooksMYLO Cookbooks

Launch an Agent with Your Cloned Voice

Clone a custom voice with Sonus and give your MYLO agent your own sound.

  • Clone a voice with POST /v1/audio/clone and save the voice_id
  • Pass the cloned voice_id into a MYLO session
  • Test quality over WebSocket and fall back to presets if needed Time to complete: ~20 minutes

Prerequisites

  • SAGEA_API_KEY exported in your shell as Bearer auth
  • Python 3.10+ with requests and websocket-client installed
  • A clean 1 to 2 minute WAV sample with consent to clone
  • Complete Send your first API request
  • Read the MYLO overview import from '@/components/Tabs';

Step 1: Clone your voice with Sonus

Upload a sample to Sonus and capture the returned voice_id.

curl -X POST https://api.sagea.space/v1/audio/clone \
  -H "Authorization: Bearer $SAGEA_API_KEY" \
  -F "name=my-support-voice" -F "sample=@./voice-sample.wav"
# Response includes voice_id like voice_abc123

Use a quiet recording with varied sentences for the most natural clone.

Step 2: Start a MYLO session with the cloned voice

Pass the Sonus voice_id as voice when creating the session.

VOICE_ID="voice_REPLACE_ME"
curl -X POST https://api.sagea.space/mylo/sessions \
  -H "Authorization: Bearer $SAGEA_API_KEY" -H "Content-Type: application/json" \
  -d "{\"agent_id\":\"support_np\",\"model\":\"sage-2-5-celer\",\"voice\":\"$VOICE_ID\",\"language\":\"ne-NP\"}"

Swap back to presets nova or atlas anytime by changing voice.

Step 3: Test, fetch transcript, and clean up

Join the WebSocket, verify tone, then fetch transcript and delete.

SESSION_ID="mylo_ses_REPLACE_ME"
curl https://api.sagea.space/mylo/sessions/$SESSION_ID/transcript \
  -H "Authorization: Bearer $SAGEA_API_KEY"
curl -X DELETE https://api.sagea.space/mylo/sessions/$SESSION_ID \
  -H "Authorization: Bearer $SAGEA_API_KEY"

If quality drops, re-clone with a longer sample or use nova temporarily.

Verify

ErrorCauseFix
401 UnauthorizedMissing or invalid API keyExport valid SAGEA_API_KEY and retry
404 session_not_foundSession expired during voice testCreate new session with same voice_id
429 rate_limit_exceededClone plus session burst throttledWait, then retry session create alone
422 voice_not_foundBad or deleted voice_idRe-clone via Sonus, verify ID copy

What's next

On this page