#!/usr/bin/env bash
# List available ElevenLabs voices
set -euo pipefail
# shellcheck source=/dev/null
[ -f /root/clawd/.env ] && set -a && . /root/clawd/.env && set +a

if [ -z "${ELEVENLABS_API_KEY:-}" ]; then
  echo "Error: ELEVENLABS_API_KEY not set" >&2
  exit 1
fi

curl -s \
  -H "xi-api-key: ${ELEVENLABS_API_KEY}" \
  "https://api.elevenlabs.io/v1/voices" \
  | python3 -c "
import json, sys
data = json.load(sys.stdin)
voices = data.get('voices', [])
out = [{'voice_id': v['voice_id'], 'name': v['name'], 'labels': v.get('labels', {})} for v in voices]
print(json.dumps(out, indent=2))
"
