设计与多媒体

ElevenLabs

试用

通过托管认证接入 ElevenLabs API,实现文本转语音、声音克隆与音效生成。

它能做什么

所有请求经 Maton 网关转发至 api.elevenlabs.io,基地址为 api.maton.ai/elevenlabs/,使用 MATON_API_KEY Bearer 令牌认证,并通过 /connections 管理 ElevenLabs OAuth 连接。覆盖文本转语音、声音克隆与管理、音效生成、音频降噪、语音转文字、语音转语音、项目管理及发音词典等接口,新增连接与写操作均需用户明确确认。

什么时候用它

  • 将文本合成为语音音频
  • 克隆或管理自定义声音
  • 通过文本提示生成音效
  • 转写或转换语音音频

技能文档

ElevenLabs

Access the ElevenLabs API with managed authentication. Generate lifelike speech from text, clone voices, create sound effects, and process audio.

Quick Start

# List available voices
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/elevenlabs/v1/voices')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Base URL

https://api.maton.ai/elevenlabs/{native-api-path}

Maton proxies requests to api.elevenlabs.io and automatically injects your API key.

Authentication

All requests require the Maton API key in the Authorization header:

Authorization: Bearer $MATON_API_KEY

Environment Variable: Set your API key as MATON_API_KEY:

export MATON_API_KEY="YOUR_API_KEY"

Getting Your API Key

  1. Sign in or create an account at maton.ai
  2. Go to maton.ai/settings
  3. Copy your API key

Connection Management

Manage your ElevenLabs connections at https://api.maton.ai.

List Connections

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections?app=elevenlabs&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Create Connection

python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'elevenlabs'}).encode()
req = urllib.request.Request('https://api.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Get Connection

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Response:

{
  "connection": {
    "connection_id": "{connection_id}",
    "status": "ACTIVE",
    "creation_time": "2026-02-12T00:50:40.292363Z",
    "last_updated_time": "2026-02-12T00:51:14.547893Z",
    "url": "https://connect.maton.ai/?session_token=...",
    "app": "elevenlabs",
    "metadata": {}
  }
}

Open the returned url in a browser to complete authorization.

Delete Connection

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Specifying Connection

If you have multiple ElevenLabs connections, specify which one to use with the Maton-Connection header:

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/elevenlabs/v1/voices')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Maton-Connection', '{connection_id}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

If you have multiple connections, always include this header to ensure requests go to the intended account.

Security & Permissions

  • Access is scoped to text-to-speech, voices, voice cloning, audio generation, and projects within the connected ElevenLabs account.
  • 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.

API Reference

Text-to-Speech

Convert Text to Speech

POST /elevenlabs/v1/text-to-speech/{voice_id}
Content-Type: application/json

{
  "text": "Hello, this is a test of the ElevenLabs API.",
  "model_id": "eleven_multilingual_v2",
  "voice_settings": {
    "stability": 0.5,
    "similarity_boost": 0.75
  }
}

Returns audio data (mp3 by default).

Query parameters:

  • output_format - Audio format (e.g., mp3_44100_128, pcm_16000, pcm_22050)

Stream Text to Speech

POST /elevenlabs/v1/text-to-speech/{voice_id}/stream
Content-Type: application/json

{
  "text": "Hello, this is streamed audio.",
  "model_id": "eleven_multilingual_v2"
}

Returns streaming audio data.

Text to Speech with Timestamps

POST /elevenlabs/v1/text-to-speech/{voice_id}/with-timestamps
Content-Type: application/json

{
  "text": "Hello world",
  "model_id": "eleven_multilingual_v2"
}

Returns audio with word-level timestamps.

Voices

List Voices

GET /elevenlabs/v1/voices

Returns all available voices including premade and cloned voices.

Get Voice

GET /elevenlabs/v1/voices/{voice_id}

Returns metadata about a specific voice.

Get Default Voice Settings

GET /elevenlabs/v1/voices/settings/default

Get Voice Settings

GET /elevenlabs/v1/voices/{voice_id}/settings

Create Voice Clone

POST /elevenlabs/v1/voices/add
Content-Type: multipart/form-data

name: My Cloned Voice
files: [audio_sample.mp3]
description: A custom voice clone
remove_background_noise: false

Edit Voice

PATCH /elevenlabs/v1/voices/{voice_id}/edit
Content-Type: multipart/form-data

name: Updated Voice Name
description: Updated description

Delete Voice

DELETE /elevenlabs/v1/voices/{voice_id}

Models

List Models

GET /elevenlabs/v1/models

Returns available models:

  • eleven_multilingual_v2 - Latest multilingual model
  • eleven_turbo_v2_5 - Low-latency model
  • eleven_monolingual_v1 - Legacy English model (deprecated)

User

Get User Info

GET /elevenlabs/v1/user

Get Subscription Info

GET /elevenlabs/v1/user/subscription

Returns subscription details including character limits and usage.

History

List History Items

GET /elevenlabs/v1/history?page_size=100

Query parameters:

  • page_size - Number of items per page (default: 100, max: 1000)
  • start_after_history_item_id - Cursor for pagination
  • voice_id - Filter by voice

Get History Item

GET /elevenlabs/v1/history/{history_item_id}

Get Audio from History

GET /elevenlabs/v1/history/{history_item_id}/audio

Returns the audio file for a history item.

Delete History Item

DELETE /elevenlabs/v1/history/{history_item_id}

Download History Items

POST /elevenlabs/v1/history/download
Content-Type: application/json

{
  "history_item_ids": ["id1", "id2", "id3"]
}

Returns a zip file with the requested audio files.

Sound Effects

Generate Sound Effect

POST /elevenlabs/v1/sound-generation
Content-Type: application/json

{
  "text": "A thunderstorm with heavy rain and distant thunder",
  "duration_seconds": 10.0
}

Query parameters:

  • output_format - Audio format (e.g., mp3_44100_128)

Audio Isolation

Remove Background Noise

POST /elevenlabs/v1/audio-isolation
Content-Type: multipart/form-data

audio: [audio_file.mp3]

Returns cleaned audio with background noise removed.

Stream Audio Isolation

POST /elevenlabs/v1/audio-isolation/stream
Content-Type: multipart/form-data

audio: [audio_file.mp3]

Speech-to-Text

Transcribe Audio

POST /elevenlabs/v1/speech-to-text
Content-Type: multipart/form-data

audio: [audio_file.mp3]
model_id: scribe_v1

Returns transcription with optional word-level timestamps.

Speech-to-Speech (Voice Changer)

Convert Voice

POST /elevenlabs/v1/speech-to-speech/{voice_id}
Content-Type: multipart/form-data

audio: [source_audio.mp3]
model_id: eleven_multilingual_sts_v2

Transforms audio to use a different voice while preserving intonation.

Projects

List Projects

GET /elevenlabs/v1/projects

Get Project

GET /elevenlabs/v1/projects/{project_id}

Create Project

POST /elevenlabs/v1/projects
Content-Type: application/json

{
  "name": "My Audiobook Project",
  "default_title_voice_id": "voice_id",
  "default_paragraph_voice_id": "voice_id"
}

Pronunciation Dictionaries

List Pronunciation Dictionaries

GET /elevenlabs/v1/pronunciation-dictionaries

Create Pronunciation Dictionary

POST /elevenlabs/v1/pronunciation-dictionaries/add-from-file
Content-Type: multipart/form-data

name: My Dictionary
file: [lexicon.pls]

Response Headers

ElevenLabs API responses include useful headers:

  • x-character-count - Characters used in the request
  • request-id - Unique request identifier

Pagination

History and other list endpoints use cursor-based pagination:

GET /elevenlabs/v1/history?page_size=100&start_after_history_item_id=last_item_id

Code Examples

JavaScript - Text to Speech

const response = await fetch(
  'https://api.maton.ai/elevenlabs/v1/text-to-speech/JBFqnCBsd6RMkjVDRZzb',
  {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.MATON_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      text: 'Hello world!',
      model_id: 'eleven_multilingual_v2'
    })
  }
);
const audioBuffer = await response.arrayBuffer();

Python - Text to Speech

import os
import requests

response = requests.post(
    'https://api.maton.ai/elevenlabs/v1/text-to-speech/JBFqnCBsd6RMkjVDRZzb',
    headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'},
    json={
        'text': 'Hello world!',
        'model_id': 'eleven_multilingual_v2'
    }
)
audio_data = response.content
with open('output.mp3', 'wb') as f:
    f.write(audio_data)

Python - List Voices

import os
import requests

response = requests.get(
    'https://api.maton.ai/elevenlabs/v1/voices',
    headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'}
)
voices = response.json()
for voice in voices['voices']:
    print(f"{voice['name']}: {voice['voice_id']}")

Notes

  • Text-to-Speech is billed per character
  • Sound Effects are billed per generation
  • Speech-to-Text is billed per audio minute
  • Audio output format can be specified as codec_sample_rate_bitrate (e.g., mp3_44100_128)
  • Models available: eleven_multilingual_v2 (recommended), eleven_turbo_v2_5 (low latency)
  • Voice IDs can be found using the List Voices endpoint
  • Maximum text length varies by model
  • IMPORTANT: When using curl commands, use curl -g when URLs contain brackets to disable glob parsing
  • IMPORTANT: When piping curl output to jq, environment variables may not expand correctly. Use Python examples instead.

Error Handling

StatusMeaning
400Missing ElevenLabs connection or invalid request
401Invalid or missing Maton API key
403Insufficient permissions or quota exceeded
422Invalid parameters
429Rate limited
4xx/5xxPassthrough error from ElevenLabs API

Troubleshooting: API Key Issues

  1. Check that the MATON_API_KEY environment variable is set:
echo $MATON_API_KEY
  1. Verify the API key is valid by listing connections:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Troubleshooting: Invalid App Name

  1. Ensure your URL path starts with elevenlabs. For example:
  • Correct: https://api.maton.ai/elevenlabs/v1/voices
  • Incorrect: https://api.maton.ai/v1/voices

Resources

常见问题

认证如何处理?
请求头携带 MATON_API_KEY 作为 Bearer 令牌,Maton 自动注入 ElevenLabs 上游密钥。可通过 /connections 创建、查询、删除 ElevenLabs 连接,多账户场景用 Maton-Connection 头指定目标连接。
覆盖哪些 API 范围?
包括文本转语音(普通、流式、带时间戳)、声音(列表、详情、克隆、编辑、删除、设置)、模型、用户与订阅、历史记录(列表、详情、音频、删除、批量下载)、音效生成、音频降噪、语音转文字、语音转语音、项目以及发音词典。
写操作是否需要用户确认?
需要。访问范围限定在 TTS、声音、克隆、音频生成与项目,所有 create、update、delete 调用前都必须先与用户确认目标与影响。

相关技能

ElevenLabs (elevenlabs.io). Use this skill for ANY ElevenLabs request — reading, creating, updating, and deleting data. Whenever a task involves ElevenLabs,...

10 次安装

通过 OAuth 代理调用 Twilio API,完成短信发送、语音外呼与电话号资源管理。

作者 byungkyu173 次安装8 星标

Generate speech, dialogue, and sound with ElevenLabs through RunAPI. Use when the user asks an agent to create speech, dialogue, or sound effects, or transcribe audio with ElevenLabs. Default to the RunAPI CLI for one-off generation; use SDKs only when the user is integrating RunAPI into an app or backend.

12 次安装

Use when AudioClaw Skills needs to understand a user voice message with AudioClaw ASR, including speech-to-text, model routing for deepthink or pro features,...

23 次安装

调用 ElevenLabs API,提供 18 种人声角色、32 种语言合成、音效生成与自定义人声设计。

275 次安装16 星标

通过托管网关和单一 API Key 调用 fal.ai 的图像、视频、音频与超分模型。

27 次安装