Terminal
Terminal/Skill
Walks through getting an ElevenLabs API key, saving it to a local .env file and checking that it works.
By ElevenLabs
Works with
npx skills add elevenlabs/skills --skill setup-api-keyGuide the user through obtaining and configuring an ElevenLabs API key.
Before asking the user for a key, check for an existing ELEVENLABS_API_KEY:
ELEVENLABS_API_KEY exists in the current environment. If it does, use that value for this initial check..env for ELEVENLABS_API_KEY=<value>.GET https://api.elevenlabs.io/v1/user
Header: xi-api-key: <existing-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!
Do not paste the key into this chat. Instead, copy/paste it into your local
.envfile:ELEVENLABS_API_KEY=your-api-keyIf
.envalready has anELEVENLABS_API_KEY=...line, replace that line. Tell me when you've saved it, without sharing the key.
Then wait for the user to confirm that the key is saved locally.
After the user says the key is saved:
.env and the current environment for ELEVENLABS_API_KEY, but treat .env as the source of truth for this step..env contains a value, validate that value even when the current environment also has a different ELEVENLABS_API_KEY..env does not contain the key:
.env does not appear to contain ELEVENLABS_API_KEY..env..env key is found, validate it:
GET https://api.elevenlabs.io/v1/user
Header: xi-api-key: <local-api-key>
.env value and tell you when it is saved.Done. ElevenLabs is configured and the key in
.envworks.
.env..env or managed secrets over shell history for persistent local configuration.ELEVENLABS_API_KEY on the server and issue short-lived tokens where applicable.