mirror of
https://github.com/taigrr/elevenlabs.git
synced 2026-04-02 11:19:01 -07:00
30 lines
441 B
Go
30 lines
441 B
Go
package client
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
const apiEndpoint = "https://api.elevenlabs.io"
|
|
|
|
var (
|
|
ErrUnauthorized = errors.New("unauthorized")
|
|
ErrUnspecified = errors.New("unspecified error")
|
|
)
|
|
|
|
type Client struct {
|
|
apiKey string
|
|
endpoint string
|
|
}
|
|
|
|
func New(apiKey string) Client {
|
|
return Client{
|
|
apiKey: apiKey,
|
|
endpoint: apiEndpoint,
|
|
}
|
|
}
|
|
|
|
func (c Client) WithEndpoint(endpoint string) Client {
|
|
c.endpoint = endpoint
|
|
return c
|
|
}
|