Kanzen Ads Docs
IntroductionQuickstartAuthentication
Connect to Hermes Agent
Payments / Top-up
Overview & CreditsGenerate ImageGenerate VideoRetrieve Media
Top Up Campaign AdsCharacter + Product Video
Errors & LimitsAPI ReferenceMeta Marketing API Guide

Quickstart

Jalur tercepat buat integrasi yang jalan: cek saldo kredit lo, terus generate satu gambar.

1. Ambil key Generation API

User API key (prefix hsk_) di-generate dari dashboard (System → Connections). Cuma ditampilin sekali — simpen baik-baik. Lihat Authentication buat detailnya.

2. Cek saldo lo

1

GET /api/gen/credits

curl
curl https://kanzenads.com/api/gen/credits \
  -H "x-api-key: hsk_your_key_here"
Response 200
{
  "balance": 50000,
  "transactions": [
    { "id": "tx_1", "amount": -400, "reason": "image_generation", "balanceAfter": 50000, "createdAt": "2026-07-08T10:00:00Z" }
  ]
}
2

Generate satu gambar

curl
curl -X POST https://kanzenads.com/api/gen/image \
  -H "x-api-key: hsk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Product photo on a clean white background", "size": "1:1", "n": 1}'
Response 201
{
  "id": "clx1a2b3c4",
  "status": "processing",
  "creditsCost": 400,
  "balanceAfter": 49600
}
3

Poll sampai selesai

curl — every 5–10s
curl https://kanzenads.com/api/gen/media/clx1a2b3c4 \
  -H "x-api-key: hsk_your_key_here"
Response 200 — completed
{
  "id": "clx1a2b3c4",
  "status": "completed",
  "mediaType": "IMAGE",
  "videoUrl": "https://kanzenads.com/api/photos/serve/generated/clx1a2b3c4.png",
  "thumbnailUrl": null,
  "createdAt": "2026-07-08T10:00:00Z",
  "completedAt": "2026-07-08T10:02:11Z"
}
⚠️

videoUrl juga nyimpen gambar

Endpoint retrieve single-item (GET /api/gen/media/:id) selalu balikin file di key videoUrl, bahkan buat gambar — nggak ada field imageUrl terpisah di endpoint ini. (Endpoint list GET /api/gen/image me-remap-nya ke imageUrl, tapi yang single-item nggak.) Lihat Retrieve Media.

Langkah selanjutnya

  • Baca Generate Video buat animasiin karakter atau produk.
← IntroductionAuthentication →