Installation¶
Requirements¶
- Go 1.21 or later
- An ElevenLabs API key (get one here)
Install the SDK¶
Get Your API Key¶
- Sign up at elevenlabs.io
- Go to your Profile Settings
- Copy your API key
Set Up Authentication¶
The SDK can read your API key from the environment:
Or pass it directly when creating the client:
Verify Installation¶
package main
import (
"context"
"fmt"
"log"
elevenlabs "github.com/agentplexus/go-elevenlabs"
)
func main() {
client, err := elevenlabs.NewClient()
if err != nil {
log.Fatal(err)
}
// Check subscription
sub, err := client.User().GetSubscription(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("Connected! Tier: %s, Characters remaining: %d\n",
sub.Tier, sub.CharactersRemaining())
}
Next Steps¶
- Quick Start - Generate your first audio
- Configuration - Advanced client options