| sidebar_position | 2 |
|---|---|
| title | Authentication |
| description | Configure the Go SDK with the app-credentials flow and understand the supported auth modes. |
Use app credentials mode for production session integrations.
Create AgoraClient with AppID and AppCertificate, then let AgentSession generate the ConvoAI REST auth token and the RTC join token automatically.
package main
import (
"github.com/AgoraIO/agora-agents-go/v2/agentkit"
"github.com/AgoraIO/agora-agents-go/v2/option"
)
func main() {
client := agentkit.NewAgoraClient(agentkit.AgoraClientOptions{
Area: option.AreaUS,
AppID: "your-app-id",
AppCertificate: "your-app-certificate",
})
_ = client
}- The SDK handles ConvoAI REST auth and RTC join token generation for you.
- Your session code stays focused on agent behavior while the SDK handles auth details.
- Your quick start code stays vendor-key free when you use supported Agora-managed global models.
The generated REST client still contains legacy auth hooks for prebuilt REST tokens and HTTP Basic Auth. Do not use those for new session integrations. Use app credentials so AgentKit can mint short-lived ConvoAI REST auth and RTC join tokens for each session.
import "fmt"
fmt.Println(client.AuthMode) // "app-credentials"