API Integrasi

Buat konten (newsletter, caption, artikel), transkrip, dan pisah pembicara secara terprogram. Kuota menit mengikuti workspace pemilik API key.

Autentikasi: kirim header Authorization: Bearer <API_KEY>. Buat API key dari tab Tim & API di aplikasi. Semua response berbentuk JSON; error memakai {"error": "..."}, kuota habis mengembalikan 402.

Konten

POST /api/v1/generate

Generate 3 aset (newsletter, 5 caption hook, artikel) dari link YouTube atau transkrip. Gratis (tidak memakai kuota menit).

{
  "url": "https://youtube.com/watch?v=...",   // opsional
  "text": "paste transkrip...",               // opsional
  "lang": "id"                                // "id" | "en"
}
{
  "sections": [
    { "title": "NEWSLETTER", "content": "..." },
    { "title": "CAPTIONS",   "content": "..." },
    { "title": "ARTIKEL",    "content": "..." }
  ]
}
POST /api/v1/chat

Tanya-jawab tentang isi transkrip episode (chat dengan transkrip). Gratis, tidak memakai kuota menit.

{
  "text": "transkrip episode...",
  "question": "Rangkum dalam 3 poin",
  "history": [ { "role": "user", "content": "q1" }, { "role": "assistant", "content": "a1" } ]
}
{ "answer": "ringkasan..." }
POST /api/v1/show-notes

Buat show notes + timestamps. Dengan url YouTube → timestamp asli dari caption. Dengan text → tanpa timestamp. Gratis.

{ "url": "https://youtube.com/watch?v=..." }
{
  "timed": true,
  "notes": {
    "title": "…", "description": "…",
    "topics": [ { "time": "02:34", "text": "Bisnis online — cara mulai" } ],
    "links": [ { "name": "website", "url": "https://…" } ]
  }
}

Transkrip & diarization

POST /api/v1/transcribe

Transkripsi file audio/video (STT). Memakai kuota menit = durasi audio.

{ "data": "<base64 file>", "ext": "mp3" }
{ "transcript": "teks...", "minutes": 60 }
POST /api/v1/diarize

Pisah pembicara. Dengan url YouTube → audio asli + AssemblyAI (memakai kuota menit). Dengan text → segmentasi LLM (gratis).

{ "url": "https://youtube.com/watch?v=..." }
{
  "labeled": "[Speaker 1]\n...\n\n[Speaker 2]\n...",
  "speakers": [ { "speaker": 1, "text": "..." } ]
}

Galeri audio

POST /api/v1/library/youtube

Scrape audio YouTube ke galeri (B2).

{ "url": "https://youtube.com/watch?v=...", "title": "opsional" }
{ "item": { "id": "...", "title": "...", "source": "youtube", "minutes": 46 } }
POST /api/v1/library/upload

Upload file audio/video ke galeri.

{ "data": "<base64 file>", "ext": "m4a", "title": "opsional" }
GET /api/v1/library

Daftar item galeri workspace.

{ "items": [ { "id": "...", "title": "...", "source": "youtube" } ] }
POST /api/v1/library/:id/diarize

Pisah pembicara dari item galeri. Memakai kuota menit.

POST /api/v1/library/:id/generate

Transkrip (AssemblyAI) + generate aset dari item galeri. Memakai kuota menit.

{ "lang": "id" }
DELETE /api/v1/library/:id

Hapus item galeri.

Usage

GET /api/v1/usage

Sisa kuota menit bulan ini.

{ "plan": "free", "minutesUsed": 120, "minuteQuota": 180 }

Contoh (Node)

const KEY = 'rp_...';
const r = await fetch('https://podlyzer.site/api/v1/generate', {
  method: 'POST',
  headers: { 'content-type': 'application/json', authorization: 'Bearer ' + KEY },
  body: JSON.stringify({ text: transcript, lang: 'id' }),
});
const { sections } = await r.json();

Error umum: 401 API key tidak valid · 402 kuota menit habis · 500 kesalahan pemrosesan.