Quickstart
Bangun fitur AI Voice di aplikasimu dalam 3 langkah.
1. Buat API Key
Buka dashboard Vonip → API Keys → Buat key baru. Pilih:
- Public key (
pk_…) — aman untuk browser/SDK. - Secret key (
sk_…) — hanya server-side.
⚠️ Secret key tidak boleh disertakan di kode frontend.
2. Pasang SDK (klien)
<script src="https://sdk.vonip.ai/v1/vonip.js"></script>
<script>
Vonip.init({ apiKey: "pk_test_xxx" });
document.querySelector("#voice-btn").onclick = () => {
Vonip.open({ mode: "voice" });
};
Vonip.on("generated", (data) => {
document.querySelector("audio").src = data.audioUrl;
});
</script>
3. Atau panggil REST API (server)
curl -X POST https://api.vonip.ai/v1/tts \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{"text": "Halo dunia", "voice": "anime_voice"}'
Response:
{
"id": "01h…",
"kind": "tts",
"status": "ready",
"audio_url": "https://cdn.vonip.ai/tts/abc.mp3",
"duration_sec": 2
}