| sidebar_position | 3 |
|---|---|
| title | Quick Start |
| description | Build and run your first Agora Conversational AI agent in Go with app credentials and the builder API. |
This guide starts with the standard AgentKit path:
AppID,AppCertificate, andAreaonAgoraClient- the
Agentbuilder withWithStt(),WithLlm(), andWithTts() - automatic ConvoAI REST auth and RTC join token generation
- no vendor API keys when using supported Agora-managed global models
package main
import (
"context"
"fmt"
"log"
"time"
"github.com/AgoraIO/agora-agents-go/v2/agentkit"
"github.com/AgoraIO/agora-agents-go/v2/agentkit/vendors"
"github.com/AgoraIO/agora-agents-go/v2/option"
)
func main() {
ctx := context.Background()
idleTimeout := 120
client := agentkit.NewAgoraClient(agentkit.AgoraClientOptions{
Area: option.AreaUS,
AppID: "your-app-id",
AppCertificate: "your-app-certificate",
})
agent := agentkit.NewAgent(client).WithStt(
vendors.NewDeepgramSTT(vendors.DeepgramSTTOptions{
Model: "nova-3",
Language: "en",
}),
).WithLlm(
vendors.NewOpenAI(vendors.OpenAIOptions{
Model: "gpt-5-mini",
SystemMessages: []map[string]interface{}{
{"role": "system", "content": "You are a concise support voice assistant."},
},
GreetingMessage: "Hello! How can I help you today?",
MaxHistory: intPtr(10),
}),
).WithTts(
vendors.NewOpenAITTS(vendors.OpenAITTSOptions{
Model: "tts-1",
Voice: "alloy",
}),
)
session := agent.CreateSession(agentkit.CreateSessionOptions{
Name: fmt.Sprintf("conversation-%d", time.Now().UnixMilli()),
Channel: fmt.Sprintf("demo-channel-%d", time.Now().UnixMilli()),
AgentUID: "1",
RemoteUIDs: []string{"100"},
IdleTimeout: &idleTimeout,
})
agentSessionID, err := session.Start(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println("Agent started:", agentSessionID)
if err := session.Say(ctx, "Thanks for calling Agora support.", nil, nil); err != nil {
log.Fatal(err)
}
if err := session.Stop(ctx); err != nil {
log.Fatal(err)
}
}AgoraClientruns in app-credentials mode when you passAppIDandAppCertificateonly.NewAgent(client, ...)requires a non-nil client;NewAgent(nil)panics.Agentholds reusable vendor and session-behavior configuration.- Vendor constructors on the builder select the ASR, LLM, and TTS stack. Leave vendor credentials unset for supported Agora-managed global models, or provide keys when you want BYOK. CN MiniMax TTS always requires
Key. CreateSessionpasses per-session values such as channel, UID, and the agent instanceNamesent on/join.session.Start(...)lets the SDK generate the required auth tokens automatically and returns the unique agent session ID.
Use the builder without vendor API keys when you are using supported Agora-managed global models.
Use BYOK when you need to:
- supply your own vendor API keys
- use models outside the Agora-managed catalog
- point at custom vendor endpoints
- manage vendor-specific parameters directly
See BYOK Guide.