Unofficial Go Client for the ElevenLabs API
Report Bug
.
Request Feature
A Go client for interacting with the ElevenLabs API, providing easy-to-use methods for the endpoints for Administration, Conversational AI and advanced features like TTS, STT and other ElevenLabs features.
This project is currently work in progress and not all of the endpoints are supported.
- Administration
- Conversational AI
- Agents
- Text to Speech
- Speech to Text
- Text to Dialogue
- Voice Changer
- Sound Effects
- Audio Isolation
- Text to Voice
- Dubbing
- Audio Native
- Voices
- Forced Alignment
go get github.com/yzaimoglu/elevenlabs-gopackage main
import (
"fmt"
"log"
elevenlabs "github.com/yzaimoglu/elevenlabs-go"
)
func main() {
// Create a new ElevenLabs API client
// The Environment can either be EnvironmentProduction, EnvironmentProductionUS, EnvironmentProductionEU or EnvironmentProductionIndia
client, err := elevenlabs.NewClient("<YOUR_API_KEY>", elevenlabs.EnvironmentProductionEU)
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
// Use a method that calls the API (Listing all Conversational AI agents here)
agents, err := client.ConversationalAI.Agents.ListAgents()
if err != nil {
log.Fatalf("Error fetching agents: %v", err)
}
for _, a := range agents {
fmt.Printf("Agent Name: %s (ID: %s)\n", a.Name, a.AgentId)
}
}Full API documentation:
This client aims to be a 1:1 wrapper for the official ElevenLabs API endpoints. Refer to the code and GoDoc for detailed usage examples.
- Fork the repository
- Create a feature branch: git checkout -b feat/my-feature
- Commit changes: git commit -m 'Add my feature'
- Push to branch: git push origin feat/my-feature
- Create a Pull Request
- This project is heavily inspired by the structure of the unofficial Zendesk Go Client by nukosuke.
- Gopher created with Gopherize