{"skill":{"slug":"elevenlabs-api","displayName":"ElevenLabs","summary":"ElevenLabs API integration with managed authentication. AI-powered text-to-speech, voice cloning, sound effects, and audio processing. Use this skill when us...","description":"---\nname: elevenlabs\ndescription: |\n  ElevenLabs API integration with managed authentication. AI-powered text-to-speech, voice cloning, sound effects, and audio processing.\n  Use this skill when users want to generate speech from text, clone voices, create sound effects, or process audio.\n  For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).\ncompatibility: Requires network access and valid Maton API key\nmetadata:\n  author: maton\n  version: \"1.0\"\n  clawdbot:\n    emoji: 🧠\n    homepage: \"https://maton.ai\"\n    requires:\n      env:\n        - MATON_API_KEY\n---\n\n# ElevenLabs\n\nAccess the ElevenLabs API with managed authentication. Generate lifelike speech from text, clone voices, create sound effects, and process audio.\n\n## Quick Start\n\n```bash\n# List available voices\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/elevenlabs/v1/voices')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n## Base URL\n\n```\nhttps://api.maton.ai/elevenlabs/{native-api-path}\n```\n\nMaton proxies requests to `api.elevenlabs.io` and automatically injects your API key.\n\n## Authentication\n\nAll requests require the Maton API key in the Authorization header:\n\n```\nAuthorization: Bearer $MATON_API_KEY\n```\n\n**Environment Variable:** Set your API key as `MATON_API_KEY`:\n\n```bash\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n```\n\n### Getting Your API Key\n\n1. Sign in or create an account at [maton.ai](https://maton.ai)\n2. Go to [maton.ai/settings](https://maton.ai/settings)\n3. Copy your API key\n\n## Connection Management\n\nManage your ElevenLabs connections at `https://api.maton.ai`.\n\n### List Connections\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/connections?app=elevenlabs&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Create Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'elevenlabs'}).encode()\nreq = urllib.request.Request('https://api.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Get Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n**Response:**\n```json\n{\n  \"connection\": {\n    \"connection_id\": \"{connection_id}\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2026-02-12T00:50:40.292363Z\",\n    \"last_updated_time\": \"2026-02-12T00:51:14.547893Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"elevenlabs\",\n    \"metadata\": {}\n  }\n}\n```\n\nOpen the returned `url` in a browser to complete authorization.\n\n### Delete Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Specifying Connection\n\nIf you have multiple ElevenLabs connections, specify which one to use with the `Maton-Connection` header:\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/elevenlabs/v1/voices')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '{connection_id}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\nIf you have multiple connections, always include this header to ensure requests go to the intended account.\n\n## Security & Permissions\n\n- Access is scoped to text-to-speech, voices, voice cloning, audio generation, and projects within the connected ElevenLabs account.\n- **All write operations require explicit user approval.** Before executing any create, update, or delete call, confirm the target resource and intended effect with the user.\n\n## API Reference\n\n### Text-to-Speech\n\n#### Convert Text to Speech\n\n```bash\nPOST /elevenlabs/v1/text-to-speech/{voice_id}\nContent-Type: application/json\n\n{\n  \"text\": \"Hello, this is a test of the ElevenLabs API.\",\n  \"model_id\": \"eleven_multilingual_v2\",\n  \"voice_settings\": {\n    \"stability\": 0.5,\n    \"similarity_boost\": 0.75\n  }\n}\n```\n\nReturns audio data (mp3 by default).\n\nQuery parameters:\n- `output_format` - Audio format (e.g., `mp3_44100_128`, `pcm_16000`, `pcm_22050`)\n\n#### Stream Text to Speech\n\n```bash\nPOST /elevenlabs/v1/text-to-speech/{voice_id}/stream\nContent-Type: application/json\n\n{\n  \"text\": \"Hello, this is streamed audio.\",\n  \"model_id\": \"eleven_multilingual_v2\"\n}\n```\n\nReturns streaming audio data.\n\n#### Text to Speech with Timestamps\n\n```bash\nPOST /elevenlabs/v1/text-to-speech/{voice_id}/with-timestamps\nContent-Type: application/json\n\n{\n  \"text\": \"Hello world\",\n  \"model_id\": \"eleven_multilingual_v2\"\n}\n```\n\nReturns audio with word-level timestamps.\n\n### Voices\n\n#### List Voices\n\n```bash\nGET /elevenlabs/v1/voices\n```\n\nReturns all available voices including premade and cloned voices.\n\n#### Get Voice\n\n```bash\nGET /elevenlabs/v1/voices/{voice_id}\n```\n\nReturns metadata about a specific voice.\n\n#### Get Default Voice Settings\n\n```bash\nGET /elevenlabs/v1/voices/settings/default\n```\n\n#### Get Voice Settings\n\n```bash\nGET /elevenlabs/v1/voices/{voice_id}/settings\n```\n\n#### Create Voice Clone\n\n```bash\nPOST /elevenlabs/v1/voices/add\nContent-Type: multipart/form-data\n\nname: My Cloned Voice\nfiles: [audio_sample.mp3]\ndescription: A custom voice clone\nremove_background_noise: false\n```\n\n#### Edit Voice\n\n```bash\nPATCH /elevenlabs/v1/voices/{voice_id}/edit\nContent-Type: multipart/form-data\n\nname: Updated Voice Name\ndescription: Updated description\n```\n\n#### Delete Voice\n\n```bash\nDELETE /elevenlabs/v1/voices/{voice_id}\n```\n\n### Models\n\n#### List Models\n\n```bash\nGET /elevenlabs/v1/models\n```\n\nReturns available models:\n- `eleven_multilingual_v2` - Latest multilingual model\n- `eleven_turbo_v2_5` - Low-latency model\n- `eleven_monolingual_v1` - Legacy English model (deprecated)\n\n### User\n\n#### Get User Info\n\n```bash\nGET /elevenlabs/v1/user\n```\n\n#### Get Subscription Info\n\n```bash\nGET /elevenlabs/v1/user/subscription\n```\n\nReturns subscription details including character limits and usage.\n\n### History\n\n#### List History Items\n\n```bash\nGET /elevenlabs/v1/history?page_size=100\n```\n\nQuery parameters:\n- `page_size` - Number of items per page (default: 100, max: 1000)\n- `start_after_history_item_id` - Cursor for pagination\n- `voice_id` - Filter by voice\n\n#### Get History Item\n\n```bash\nGET /elevenlabs/v1/history/{history_item_id}\n```\n\n#### Get Audio from History\n\n```bash\nGET /elevenlabs/v1/history/{history_item_id}/audio\n```\n\nReturns the audio file for a history item.\n\n#### Delete History Item\n\n```bash\nDELETE /elevenlabs/v1/history/{history_item_id}\n```\n\n#### Download History Items\n\n```bash\nPOST /elevenlabs/v1/history/download\nContent-Type: application/json\n\n{\n  \"history_item_ids\": [\"id1\", \"id2\", \"id3\"]\n}\n```\n\nReturns a zip file with the requested audio files.\n\n### Sound Effects\n\n#### Generate Sound Effect\n\n```bash\nPOST /elevenlabs/v1/sound-generation\nContent-Type: application/json\n\n{\n  \"text\": \"A thunderstorm with heavy rain and distant thunder\",\n  \"duration_seconds\": 10.0\n}\n```\n\nQuery parameters:\n- `output_format` - Audio format (e.g., `mp3_44100_128`)\n\n### Audio Isolation\n\n#### Remove Background Noise\n\n```bash\nPOST /elevenlabs/v1/audio-isolation\nContent-Type: multipart/form-data\n\naudio: [audio_file.mp3]\n```\n\nReturns cleaned audio with background noise removed.\n\n#### Stream Audio Isolation\n\n```bash\nPOST /elevenlabs/v1/audio-isolation/stream\nContent-Type: multipart/form-data\n\naudio: [audio_file.mp3]\n```\n\n### Speech-to-Text\n\n#### Transcribe Audio\n\n```bash\nPOST /elevenlabs/v1/speech-to-text\nContent-Type: multipart/form-data\n\naudio: [audio_file.mp3]\nmodel_id: scribe_v1\n```\n\nReturns transcription with optional word-level timestamps.\n\n### Speech-to-Speech (Voice Changer)\n\n#### Convert Voice\n\n```bash\nPOST /elevenlabs/v1/speech-to-speech/{voice_id}\nContent-Type: multipart/form-data\n\naudio: [source_audio.mp3]\nmodel_id: eleven_multilingual_sts_v2\n```\n\nTransforms audio to use a different voice while preserving intonation.\n\n### Projects\n\n#### List Projects\n\n```bash\nGET /elevenlabs/v1/projects\n```\n\n#### Get Project\n\n```bash\nGET /elevenlabs/v1/projects/{project_id}\n```\n\n#### Create Project\n\n```bash\nPOST /elevenlabs/v1/projects\nContent-Type: application/json\n\n{\n  \"name\": \"My Audiobook Project\",\n  \"default_title_voice_id\": \"voice_id\",\n  \"default_paragraph_voice_id\": \"voice_id\"\n}\n```\n\n### Pronunciation Dictionaries\n\n#### List Pronunciation Dictionaries\n\n```bash\nGET /elevenlabs/v1/pronunciation-dictionaries\n```\n\n#### Create Pronunciation Dictionary\n\n```bash\nPOST /elevenlabs/v1/pronunciation-dictionaries/add-from-file\nContent-Type: multipart/form-data\n\nname: My Dictionary\nfile: [lexicon.pls]\n```\n\n## Response Headers\n\nElevenLabs API responses include useful headers:\n- `x-character-count` - Characters used in the request\n- `request-id` - Unique request identifier\n\n## Pagination\n\nHistory and other list endpoints use cursor-based pagination:\n\n```bash\nGET /elevenlabs/v1/history?page_size=100&start_after_history_item_id=last_item_id\n```\n\n## Code Examples\n\n### JavaScript - Text to Speech\n\n```javascript\nconst response = await fetch(\n  'https://api.maton.ai/elevenlabs/v1/text-to-speech/JBFqnCBsd6RMkjVDRZzb',\n  {\n    method: 'POST',\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`,\n      'Content-Type': 'application/json'\n    },\n    body: JSON.stringify({\n      text: 'Hello world!',\n      model_id: 'eleven_multilingual_v2'\n    })\n  }\n);\nconst audioBuffer = await response.arrayBuffer();\n```\n\n### Python - Text to Speech\n\n```python\nimport os\nimport requests\n\nresponse = requests.post(\n    'https://api.maton.ai/elevenlabs/v1/text-to-speech/JBFqnCBsd6RMkjVDRZzb',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'},\n    json={\n        'text': 'Hello world!',\n        'model_id': 'eleven_multilingual_v2'\n    }\n)\naudio_data = response.content\nwith open('output.mp3', 'wb') as f:\n    f.write(audio_data)\n```\n\n### Python - List Voices\n\n```python\nimport os\nimport requests\n\nresponse = requests.get(\n    'https://api.maton.ai/elevenlabs/v1/voices',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'}\n)\nvoices = response.json()\nfor voice in voices['voices']:\n    print(f\"{voice['name']}: {voice['voice_id']}\")\n```\n\n## Notes\n\n- Text-to-Speech is billed per character\n- Sound Effects are billed per generation\n- Speech-to-Text is billed per audio minute\n- Audio output format can be specified as `codec_sample_rate_bitrate` (e.g., `mp3_44100_128`)\n- Models available: `eleven_multilingual_v2` (recommended), `eleven_turbo_v2_5` (low latency)\n- Voice IDs can be found using the List Voices endpoint\n- Maximum text length varies by model\n- IMPORTANT: When using curl commands, use `curl -g` when URLs contain brackets to disable glob parsing\n- IMPORTANT: When piping curl output to `jq`, environment variables may not expand correctly. Use Python examples instead.\n\n## Error Handling\n\n| Status | Meaning |\n|--------|---------|\n| 400 | Missing ElevenLabs connection or invalid request |\n| 401 | Invalid or missing Maton API key |\n| 403 | Insufficient permissions or quota exceeded |\n| 422 | Invalid parameters |\n| 429 | Rate limited |\n| 4xx/5xx | Passthrough error from ElevenLabs API |\n\n### Troubleshooting: API Key Issues\n\n1. Check that the `MATON_API_KEY` environment variable is set:\n\n```bash\necho $MATON_API_KEY\n```\n\n2. Verify the API key is valid by listing connections:\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Troubleshooting: Invalid App Name\n\n1. Ensure your URL path starts with `elevenlabs`. For example:\n\n- Correct: `https://api.maton.ai/elevenlabs/v1/voices`\n- Incorrect: `https://api.maton.ai/v1/voices`\n\n## Resources\n\n- [ElevenLabs API Documentation](https://elevenlabs.io/docs/api-reference)\n- [ElevenLabs Developer Portal](https://elevenlabs.io/developers)\n- [ElevenLabs Models Overview](https://elevenlabs.io/docs/overview/models)\n- [Maton Community](https://discord.com/invite/dBfFAcefs2)\n- [Maton Support](mailto:support@maton.ai)\n","tags":{"latest":"1.0.1"},"stats":{"comments":0,"downloads":2538,"installsAllTime":13,"installsCurrent":13,"stars":3,"versions":2},"createdAt":1770895562952,"updatedAt":1778488070529},"latestVersion":{"version":"1.0.1","createdAt":1777588730635,"changelog":"- Changed the ElevenLabs API base URL from gateway.maton.ai to api.maton.ai throughout the documentation.\n- Updated all connection management endpoints to use api.maton.ai instead of ctrl.maton.ai.\n- Added a new \"Security & Permissions\" section clarifying scope and user approval for write operations.\n- Removed LICENSE.txt file from the distribution.\n- Improved instructions and examples to highlight required headers and best practices for multiple connections.","license":"MIT-0"},"metadata":{"setup":[{"key":"MATON_API_KEY","required":true}],"os":null,"systems":null},"owner":{"handle":"byungkyu","userId":"s174c3s2kc1ehqj1ytzntezj2983e2aj","displayName":"byungkyu","image":"https://avatars.githubusercontent.com/u/16563684?v=4"},"moderation":null}