Documentation
¶
Overview ¶
Package heygen provides a Go SDK for the HeyGen API.
The SDK provides access to HeyGen's video generation and real-time streaming (LiveAvatar) capabilities.
Quick Start ¶
Create a client with your API key:
client, err := heygen.New("your-api-key")
if err != nil {
log.Fatal(err)
}
List available avatars:
avatars, err := client.Avatar.List(ctx)
Generate a video:
videoID, err := client.Video.Generate(ctx, video.GenerateRequest{
Title: "My Video",
VideoInputs: []video.VideoInput{
{
Character: video.Character{
Type: "avatar",
AvatarID: "avatar_id",
},
Voice: video.VoiceInput{
Type: "text",
VoiceID: "voice_id",
InputText: "Hello, world!",
},
},
},
})
Create a streaming session:
session, err := client.Streaming.NewSession(ctx, streaming.NewSessionRequest{
Quality: streaming.QualityHigh,
AvatarID: "avatar_id",
})
Upload an asset (audio, image, video) for use in other APIs:
uploaded, err := client.Asset.Upload(ctx, asset.ContentTypeMPEG, audioFile)
// uploaded.URL is usable as video.VoiceInput{Type: "audio", AudioURL: ...}
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( IsNotFound = heygen.IsNotFound IsRateLimited = heygen.IsRateLimited )
Re-export error checking functions
View Source
var ( ErrNoAPIKey = heygen.ErrNoAPIKey ErrRateLimited = heygen.ErrRateLimited )
Re-export errors
Functions ¶
Types ¶
type Client ¶
type Client struct {
// Avatar provides access to avatar APIs.
Avatar *avatar.Client
// Voice provides access to voice APIs.
Voice *voice.Client
// Video provides access to video generation APIs.
Video *video.Client
// Streaming provides access to streaming (LiveAvatar) APIs.
Streaming *streaming.Client
// Asset provides access to the asset upload API.
Asset *asset.Client
// contains filtered or unexported fields
}
Client is the HeyGen SDK client providing access to all APIs.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package asset provides access to the HeyGen asset upload API.
|
Package asset provides access to the HeyGen asset upload API. |
|
Package avatar provides access to HeyGen avatar APIs.
|
Package avatar provides access to HeyGen avatar APIs. |
|
examples
|
|
|
list-avatars
command
Example: List all available HeyGen avatars using the v3 API.
|
Example: List all available HeyGen avatars using the v3 API. |
|
liveavatar-session
command
Example: Create a LiveAvatar streaming session with LiveKit.
|
Example: Create a LiveAvatar streaming session with LiveKit. |
|
Package heygen provides a Go client for the HeyGen API.
|
Package heygen provides a Go client for the HeyGen API. |
|
Package liveavatar provides access to the LiveAvatar real-time streaming API.
|
Package liveavatar provides access to the LiveAvatar real-time streaming API. |
|
Package omniavatar provides OmniAvatar provider implementations backed by the HeyGen API.
|
Package omniavatar provides OmniAvatar provider implementations backed by the HeyGen API. |
|
Package streaming provides access to HeyGen streaming (LiveAvatar) APIs.
|
Package streaming provides access to HeyGen streaming (LiveAvatar) APIs. |
|
Package video provides access to HeyGen video generation APIs.
|
Package video provides access to HeyGen video generation APIs. |
|
Package voice provides access to HeyGen voice APIs.
|
Package voice provides access to HeyGen voice APIs. |
Click to show internal directories.
Click to hide internal directories.