VOICE / create-a-custom-voice

Voice

Create a custom voice

Create a custom voice

Clone a voice from a reference clip of at most 120 seconds. Best results: 90–120s, quiet room, one speaker, mono WAV. MP3, FLAC, and other common containers are accepted. Custom Voices is available in the United States only (Illinois is excluded).

Console

  1. Sign in at console.x.ai and create a custom voice. Each team can create up to 30 free voices.
  2. Open the three-dot menu on the voice card and copy the Voice ID.
  3. Pass that voice_id anywhere a built-in voice works.

API create (Enterprise)

POST /v1/custom-voices is multipart. file is required. Optional fields: name, description, gender, accent, age, language, use_case, tone. Without an Enterprise plan the create call returns 403. Console create still works.

CREATE=$(curl -s -X POST https://api.x.ai/v1/custom-voices \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -F "name=Friendly Narrator" \
  -F "language=en" \
  -F "gender=female" \
  -F "tone=warm" \
  -F "use_case=narration" \
  -F "file=@reference.wav;type=audio/wav")

VOICE_ID=$(echo "$CREATE" | jq -r '.voice_id')

voice_id is 8 lowercase alphanumeric characters.

Use it

curl -X POST https://api.x.ai/v1/tts \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"text\":\"Welcome back.\",\"voice_id\":\"$VOICE_ID\",\"language\":\"en\"}" \
  --output welcome.mp3

Same id on wss://api.x.ai/v1/tts?voice=... and on Speech-to-Speech session.update as session.voice.

List team customs with GET /v1/custom-voices. Built-in voices stay on GET /v1/tts/voices — customs do not appear there. PATCH /v1/custom-voices/{voice_id} updates metadata only. Re-record means delete, then create.

Pitfalls

  • Region lock: United States only, Illinois excluded.
  • POST /v1/custom-voices is Enterprise-gated (403 otherwise). Use Console to create.
  • Customs live on GET /v1/custom-voices, not GET /v1/tts/voices.
  • Cap is 30 voices per team. voice_id is 8-character lowercase alphanumeric.
  • Console API credits are a separate bill from SuperGrok's weekly pool on grok.com.