home / skills / elevenlabs / skills / setup-api-key

setup-api-key skill

/setup-api-key

This skill guides you through obtaining and configuring an ElevenLabs API key for use with ElevenLabs MCP tools.

npx playbooks add skill elevenlabs/skills --skill setup-api-key

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.9 KB
---
name: setup-api-key
description: 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.
license: MIT
compatibility: Requires internet access to elevenlabs.io and api.elevenlabs.io.
---

# ElevenLabs API Key Setup

Guide the user through obtaining and configuring an ElevenLabs API key.

## Workflow

### 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:
> 1. Click "Create key"
> 2. Name it (or use the default)
> 3. 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
> 4. Click "Create key" to confirm
> 5. **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:

1. **Validate the key** by making a request:
   ```
   GET https://api.elevenlabs.io/v1/user
   Header: xi-api-key: <the-api-key>
   ```

2. **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

3. **If validation succeeds**, save the API key in a `.env` file:
   ```
   ELEVENLABS_API_KEY=<the-api-key>
   ```

4. **Confirm success:**
   > Done! Your key is stored as an environment variable in .env
   > Keep the key safe! Don't share it with anyone!

Overview

This skill guides users through obtaining, validating, and configuring an ElevenLabs API key for use with ElevenLabs MCP tools. It explains where to create a key, how to test it against the ElevenLabs user endpoint, and how to store it securely in a .env file. The goal is a working ELEVENLABS_API_KEY environment variable ready for TTS/STT and other ElevenLabs integrations.

How this skill works

The skill instructs the user to create or locate an API key on the ElevenLabs API keys page and paste it into the chat. It then validates the key by calling GET https://api.elevenlabs.io/v1/user with the xi-api-key header. If the key is valid, the skill shows how to save it to a .env file as ELEVENLABS_API_KEY. If validation fails, the skill provides troubleshooting and retry suggestions.

When to use it

  • You need to configure ElevenLabs for TTS, STT, or MCP tools in your project.
  • An ElevenLabs tool reports a missing or invalid API key error.
  • You are onboarding a new environment or developer and need to store credentials.
  • You want a quick way to verify an existing API key before integrating it.

Best practices

  • Create the API key at https://elevenlabs.io/app/settings/api-keys and copy it immediately — keys are shown only once.
  • Use a dedicated key with minimal required permissions for automation or CI usage.
  • Store the key in a .env file as ELEVENLABS_API_KEY and do not commit .env to source control.
  • Rotate keys periodically and revoke any unused or compromised keys.
  • Keep validation attempts limited to avoid accidental rate limits or lockouts.

Example use cases

  • Setting up a local development environment to test text-to-speech with ElevenLabs.
  • Verifying a teammate’s API key before integrating an ElevenLabs voice endpoint into an app.
  • Troubleshooting an error where the ElevenLabs client reports authentication failure.
  • Onboarding a CI pipeline that needs a secure ELEVENLABS_API_KEY environment variable.

FAQ

Where do I create an ElevenLabs API key?

Open https://elevenlabs.io/app/settings/api-keys. If you need an account, sign up at https://elevenlabs.io/app/sign-up first.

How do I validate the key?

Make a GET request to https://api.elevenlabs.io/v1/user with header xi-api-key: <your-key>. A successful response confirms the key works.

What if validation fails?

Retry pasting the key, ensure you copied it fully, and recreate the key at the API keys page if needed. If it fails again, check account permissions or contact ElevenLabs support.