PromptShop

Setup API Key

This skill guides users through obtaining and configuring an Eleven Labs API key, ensuring proper authentication for accessing Eleven Labs services. It valid...

Install

npx promptshop add setup-api-key

Details

What This Skill Does

This skill guides users through obtaining and configuring an Eleven Labs API key, ensuring proper authentication for accessing Eleven Labs services. It validates the key and provides helpful instructions, making it suitable for onboarding new users and troubleshooting API key issues.

When to Use

  • Onboard new users to Eleven Labs services.
  • Troubleshoot API key configuration issues.
  • Validate existing API keys for functionality.
  • Guide users through creating an API key.
  • Check for existing API keys in the environment.
  • Rotate or replace existing API keys.

Key Features

  • Checks for existing API keys before prompting the user.
  • Validates the API key against the Eleven Labs API.Provides clear instructions for obtaining an API key.
  • Handles invalid or expired API keys gracefully.
  • Offers a URL to the API keys page.
  • Guides the user through setting key permissions.

Guide the user through obtaining and configuring an Eleven Labs 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_KEY exists in the current environment. If it's not in the environment, check .env for ELEVENLABS_API_KEY=. 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 Eleven Labs 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 Eleven Labs, 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:

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>

  • If .env already has ELEVENLABS_API_KEY=..., replace that line
  • Otherwise add a new line for ELEVENLABS_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!Eleven Labs API Key Setup

Guide the user through obtaining and configuring an Eleven Labs 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_KEY exists in the current environment. If it's not in the environment, check .env for ELEVENLABS_API_KEY=. 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 Eleven Labs 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 Eleven Labs, 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:

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>

  • If .env already has ELEVENLABS_API_KEY=..., replace that line
  • Otherwise add a new line for ELEVENLABS_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!