Labsco
elevenlabs logo

Setup API Key

โ˜… 361

by ElevenLabs ยท part of elevenlabs/skills

Guides users through the process of setting up an ElevenLabs API key for use with ElevenLabs MCP tools. Use when the user needs to configure an ElevenLabs API key, when ElevenLabs tools fail due to missing API key, or when the user mentions needing access to ElevenLabs.

๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredNeeds API keys
๐Ÿงฉ One of 7 skills in the elevenlabs/skills package โ€” works on its own, and pairs well with its siblings.

Guides users through the process of setting up an ElevenLabs API key for use with ElevenLabs MCP tools. Use when the user needs to configure an ElevenLabs API key, when ElevenLabs tools fail due to missing API key, or when the user mentions needing access to ElevenLabs.

Inspect the full instructions your agent will receiveExpand

This is the exact playbook injected into your agent when the skill activates โ€” shown here so you can audit it before installing. You don't need to read it to use the skill.

by ElevenLabs

Guides users through the process of setting up an ElevenLabs API key for use with ElevenLabs MCP tools. Use when the user needs to configure an ElevenLabs API key, when ElevenLabs tools fail due to missing API key, or when the user mentions needing access to ElevenLabs. npx skills add https://github.com/elevenlabs/skills --skill setup-api-key Download ZIPGitHub361

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_KEY exists in the current environment. If it does, use that value for this initial check.

  • Only if it is not in the environment, check .env for ELEVENLABS_API_KEY=<value>.

  • Do not print, quote, or repeat the key. If you mention it, redact it.

  • If an existing key is found, validate it:

Copy & paste โ€” that's it
GET https://api.elevenlabs.io/v1/user
Header: xi-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!

Do not paste the key into this chat. Instead, copy/paste it into your local .env file:

Copy & paste โ€” that's it
ELEVENLABS_API_KEY=your-api-key

If .env already has an ELEVENLABS_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.

Step 2: Validate and configure

After the user says the key is saved:

  • Re-check both .env and the current environment for ELEVENLABS_API_KEY, but treat .env as the source of truth for this step.

  • If .env contains a value, validate that value even when the current environment also has a different ELEVENLABS_API_KEY.

  • If .env does not contain the key:

  • Tell the user .env does not appear to contain ELEVENLABS_API_KEY.

  • Show the expected line again.

  • If the current environment does contain a key, note that this step still requires saving the key in .env.

  • Remind them not to paste the key into chat.

  • If a .env key is found, validate it:

Copy & paste โ€” that's it
GET https://api.elevenlabs.io/v1/user
Header: xi-api-key: 
  • If validation fails:

  • Tell the user the local key appears invalid or expired.

  • Remind them of the API keys page.

  • Ask them to replace the .env value and tell you when it is saved.

  • If validation succeeds, confirm:

Done. ElevenLabs is configured and the key in .env works.

Safety Rules

  • Never ask the user to paste an API key, token, or secret into chat.

  • Never print or echo API key values from environment variables or .env.

  • Prefer .env or managed secrets over shell history for persistent local configuration.

  • For browser or client-side apps, keep ELEVENLABS_API_KEY on the server and issue short-lived tokens where applicable.