setup-api-key by elevenlabs/skills
npx skills add https://github.com/elevenlabs/skills --skill setup-api-key引导用户获取并配置 ElevenLabs API 密钥。
在向用户索要密钥之前,先检查是否存在现有的 ELEVENLABS_API_KEY:
检查当前环境中是否存在 ELEVENLABS_API_KEY。
如果环境中没有,检查 .env 文件中是否有 ELEVENLABS_API_KEY=<value>。
如果找到现有密钥,验证它:
GET https://api.elevenlabs.io/v1/user
Header: xi-api-key: <existing-api-key>
如果现有密钥验证成功:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
告知用户:
要设置 ElevenLabs,请打开 API 密钥页面:https://elevenlabs.io/app/settings/api-keys
(需要账户?请先在此处创建:https://elevenlabs.io/app/sign-up)
如果您还没有 API 密钥:
- 点击 "Create key"
- 为其命名(或使用默认名称)
- 为您的密钥设置权限。如果您提供的密钥 "User" 权限设置为 "Read",此技能将自动验证您的密钥是否有效
- 点击 "Create key" 进行确认
- 立即复制密钥 - 它只显示一次!
准备好后,请在此处粘贴您的 API 密钥。
然后等待用户的下一条消息,其中应包含 API 密钥。
一旦用户提供了 API 密钥:
通过发起请求来验证密钥:
GET https://api.elevenlabs.io/v1/user
Header: xi-api-key: <the-api-key>
如果验证失败:
如果验证成功,将 API 密钥保存在 .env 文件中:
ELEVENLABS_API_KEY=<the-api-key>
.env 文件中已有 ELEVENLABS_API_KEY=...,则替换该行ELEVENLABS_API_KEY 添加新行确认成功:
完成!您的密钥已作为环境变量存储在 .env 文件中。请妥善保管密钥!不要与任何人共享!
每周安装量
1.3K
仓库
GitHub 星标数
142
首次出现
2026年1月27日
安全审计
安装于
codex969
gemini-cli958
opencode948
claude-code901
github-copilot849
kimi-cli794
Guide the user through obtaining and configuring an ElevenLabs API key.
Before asking the user for a key, check for an existing ELEVENLABS_API_KEY:
Check whether ELEVENLABS_API_KEY exists in the current environment.
If it's not in the environment, check .env for ELEVENLABS_API_KEY=<value>.
If an existing key is found, validate it :
GET https://api.elevenlabs.io/v1/user
Header: xi-api-key: <existing-api-key>
If existing key validation succeeds:
If existing key validation fails:
Tell the user:
To set up ElevenLabs, open the API keys page: https://elevenlabs.io/app/settings/api-keys
(Need an account? Create one at https://elevenlabs.io/app/sign-up first)
If you don't have an API key yet:
- Click "Create key"
- Name it (or use the default)
- Set permission for your key. If you provide a key with "User" permission set to "Read" this skill will automatically verify if your key works
- Click "Create key" to confirm
- Copy the key immediately - it's only shown once!
Paste your API key here when ready.
Then wait for the user's next message which should contain the API key.
Once the user provides the API key:
Validate the key by making a request:
GET https://api.elevenlabs.io/v1/user
Header: xi-api-key: <the-api-key>
If validation fails:
If validation succeeds , save the API key in a .env file:
ELEVENLABS_API_KEY=<the-api-key>
.env already has ELEVENLABS_API_KEY=..., replace that lineELEVENLABS_API_KEYDone! Your key is stored as an environment variable in .env Keep the key safe! Don't share it with anyone!
Weekly Installs
1.3K
Repository
GitHub Stars
142
First Seen
Jan 27, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
codex969
gemini-cli958
opencode948
claude-code901
github-copilot849
kimi-cli794
99,500 周安装
Confirm success: