BuildShip Logo
BuildShip Community

ElevenLabs Get Signed URL

Generate a signed WebSocket URL for an ElevenLabs Conversational AI agent. Accepts an agent ID as input, requests a signed URL from ElevenLabs, and returns the signed URL in a JSON response for use in establishing real-time conversations.

60

Report this template

Select the reason for reporting

Describe the issue in detail

Share template

Link to template

https://templates.buildship.com/template/JPWdXp2a1xb5/

Inputs

Agent ID

1234abcd-5678-efgh-9012-ijklmnopqrst
This is a static example using sample inputs. Remix the template to run it with your own values.

Output

Read me

đź“– ElevenLabs Conversational AI - Secure WebSocket URL Workflow

Overview

This BuildShip workflow provides a secure backend solution for integrating ElevenLabs Conversational AI into your FlutterFlow applications. It acts as a proxy that keeps your ElevenLabs API key secure on the server-side while providing signed WebSocket URLs to your Flutter app for real-time voice conversations.

Purpose

When implementing ElevenLabs Conversational AI in a client-side application, exposing your API key directly in the app code poses a significant security risk. This workflow solves that problem by:

  • Storing your ElevenLabs API key securely in BuildShip's backend
  • Providing a public endpoint that your FlutterFlow app can call
  • Returning signed WebSocket URLs that allow direct communication with ElevenLabs agents
  • Eliminating the need to embed API keys in your mobile/web application

Workflow Components

1. REST API Trigger

  • Method: GET
  • Path: /GetSignedUrl
  • Input Parameter: agentId (query parameter)
  • Content Type: application/json

2. Get Signed WebSocket URL Node

  • Fetches a signed WebSocket URL from ElevenLabs API
  • Uses the securely stored API key from BuildShip integrations
  • Returns the signed URL for establishing WebSocket connections

Setup Instructions

Step 1: Import the Workflow

  1. Copy the provided workflow JSON
  2. In BuildShip, create a new workflow or import the JSON
  3. The workflow will automatically create the necessary nodes

Step 2: Configure ElevenLabs API Key

  1. In the BuildShip workflow, click on the "Get Signed WebSocket URL" node
  2. Click on the integration key dropdown
  3. Select "Add New Integration Key" or choose an existing ElevenLabs key
  4. Enter your ElevenLabs API key (found in your ElevenLabs dashboard under Profile Settings)
  5. Save the integration

Step 3: Deploy the Workflow

  1. Click the "Deploy" button in BuildShip
  2. Copy the generated endpoint URL (it will look like: https://your-project.buildship.run/GetSignedUrl)

Step 4: Configure Your ElevenLabs Agent

  1. Log into your ElevenLabs account
  2. Create or select a Conversational AI agent
  3. Note down the Agent ID (format: agent_01jzmvwhxhf6kaya6n6zbtd0s1)

Usage in FlutterFlow

API Call Setup

  1. In FlutterFlow, create an API call with these settings:

Example API Call

GET https://your-project.buildship.run/GetSignedUrl?agentId=agent_01jzmvwhxhf6kaya6n6zbtd0s1

Response Format

{ "signedUrl": "wss://api.elevenlabs.io/v1/convai/conversation?agent_id=your-agent-id&conversation_signature=your-token" }

Implementing in FlutterFlow

  1. Create a function to call your BuildShip endpoint
  2. Extract the signedUrl from the response
  3. Use this URL to establish a WebSocket connection for voice conversations
  4. The signed URL is temporary and should be fetched when needed

Security Considerations

  • API Key Protection: Your ElevenLabs API key is never exposed to the client
  • Signed URLs: The returned WebSocket URLs are signed and time-limited
  • Agent ID Validation: Only valid agent IDs associated with your account will work
  • HTTPS Only: All communication happens over secure HTTPS/WSS protocols

Troubleshooting

Common Issues

  1. "ElevenLabs API key is required" Error
    • Ensure you've configured the API key in the BuildShip integration settings
    • Verify the key is valid and active in your ElevenLabs account
  2. "Agent ID is required" Error
    • Make sure you're passing the agentId as a query parameter
    • Check that the parameter name is exactly agentId (case-sensitive)
  3. Invalid Agent ID
    • Verify the agent ID matches one created in your ElevenLabs account
    • Ensure the agent is active and properly configured
  4. Connection Issues
    • Check that your BuildShip workflow is deployed
    • Verify the endpoint URL is correct
    • Ensure your ElevenLabs account has sufficient credits

Best Practices

  1. Error Handling: Implement proper error handling in your FlutterFlow app for API failures
  2. Caching: Don't cache signed URLs for extended periods as they may expire
  3. Rate Limiting: Be mindful of API rate limits on both BuildShip and ElevenLabs
  4. Monitoring: Use BuildShip's logs to monitor usage and troubleshoot issues

Support

License

This workflow is provided as-is for use with the ElevenLabs Conversational AI Library in FlutterFlow. Ensure you comply with both ElevenLabs' and BuildShip's terms of service.