TTS provider that sends text to ElevenLabs API and returns MP3 audio.
// Source: https://github.com/fastclaw-ai/fastclaw | License: Apache-2.0 | Copyright 2026 ThinkAny, LLC
// Provided via justclaw.it.com; keep this notice with the code.
package tts
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"time"
"github.com/fastclaw-ai/fastclaw/internal/toolproviders"
)
// ElevenLabs posts to /v1/text-to-speech/{voice_id} with the API key in the
// non-standard `xi-api-key` header. Model (the suffix in
// "elevenlabs/<model>") defaults to "eleven_multilingual_v2"; Voice defaults
// to the long-standing built-in "Rachel" voice. Response is raw audio/mpeg.
type ElevenLabs struct{}
func (ElevenLabs) Category() string { return Category }
func (ElevenLabs) Name() string { return "elevenlabs" }
// elevenLabsDefaultVoice is the voice_id us
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key