elevenlabs-setup-api-key
کلید ElevenLabs را امن تنظیم، اعتبارسنجی و در فایل .env ذخیره کنید.
این اسکیل ابتدا وجود ELEVENLABS_API_KEY را در environment و فایل .env بررسی میکند و در صورت وجود، کلید را با API رسمی ElevenLabs اعتبارسنجی میکند.
اگر کلید موجود نباشد یا منقضی شده باشد، مسیر دریافت کلید جدید را توضیح میدهد، آن را بررسی میکند و پس از موفقیت در .env ذخیره میکند تا ابزارهای ElevenLabs MCP آماده استفاده شوند.
چه چیزی میگیرید
- بررسی خودکار کلید موجود در environment و `.env`
- اعتبارسنجی کلید با endpoint رسمی `api.elevenlabs.io`
- راهنمای مرحلهبهمرحله ساخت کلید از پنل ElevenLabs
- جایگزینی یا افزودن `ELEVENLABS_API_KEY` در فایل `.env`
- هشدار درباره نگهداری امن و عدم اشتراکگذاری کلید
برای چه کاری خوب است
- توسعهدهندگانی که میخواهند ابزارهای ElevenLabs MCP را برای نخستینبار فعال کنند
- پروژههای تولید ویدیو، voiceover یا تبدیل متن به گفتار که با خطای نبود API key مواجه شدهاند
- زمانی که نیاز دارید اعتبار یک کلید موجود را بررسی یا آن را rotate کنید
برای چه کاری نیست
- ساخت محتوای صوتی یا استفاده مستقیم از قابلیتهای text-to-speech
- زمانی که به API key سرویس دیگری مانند OpenAI یا Google نیاز دارید
- محیطهایی که دسترسی اینترنت به `elevenlabs.io` و `api.elevenlabs.io` ندارند
دربارهٔ این اسکیل
ElevenLabs API Key Setup
Guide the user through obtaining and configuring an ElevenLabs API key.
Workflow
Step 0: Check for an existing API key first
Before asking the user for a key, check for an existing ELEVENLABS_API_KEY:
- Check whether
ELEVENLABS_API_KEYexists in the current environment. - If it's not in the environment, check
.envforELEVENLABS_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: - Tell the user ElevenLabs is already configured and working - Skip the setup flow - Ask whether they want to replace/rotate the key; if not, stop
- If existing key validation fails: - Tell the user the existing key appears invalid or expired - Continue to Step 1
Step 1: Request the API key
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.
Step 2: Validate and configure
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: - Tell the user the API key appears to be invalid - Ask them to try again - Remind them of the URL: https://elevenlabs.io/app/settings/api-keys - If it fails a second time, display an error and exit
- If validation succeeds, save the API key in a
.envfile: ``ELEVENLABS_API_KEY=<the-api-key>`- If.envalready hasELEVENLABS_API_KEY=..., replace that line - Otherwise add a new line forELEVENLABS_API_KEY`
- Confirm success: > Done! Your key is stored as an environment variable in .env > Keep the key safe! Don't share it with anyone!