const resp = await fetch("https://api.slng.ai/v1/agents", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Appointment Reminder",
system_prompt:
"You are a friendly appointment reminder for {{clinic_name}}. " +
"Confirm the patient upcoming visit or help them reschedule. " +
"Keep responses to one or two sentences.",
greeting: "Hi {{patient_name}}, this is a reminder from {{clinic_name}} about your upcoming appointment.",
language: "en",
models: {
stt: "slng/deepgram/nova:3-en",
llm: "groq/moonshotai/kimi-k2-instruct-0905",
tts: "slng/deepgram/aura:2-en",
tts_voice: "aura-2-thalia-en",
},
template_defaults: {
clinic_name: "Downtown Health Clinic",
patient_name: "there",
},
livekit_deployment: "default-eu",
slng_api_key: "YOUR_API_KEY",
}),
});
const agent = await resp.json();
console.log(agent.id);