Back to home

Webhooks

Get notified when generations finish instead of polling.

Last updated: August 2026

Events

generation.completedA generation finished successfully
generation.failedA generation failed
credits.lowBalance dropped below 10 credits
credits.depletedBalance reached 0

Payload

{
  "event": "generation.completed",
  "data": {
    "id": 1284,
    "status": "completed",
    "type": "icon",
    "result_url": "https://storage.museai.xeycompany.com/icon_abc.png",
    "credits_used": 1,
    "credits_remaining": 499
  }
}

Signature verification

Signatures use HMAC-SHA256 with your webhook secret, sent in the X-MuseAI-Signature header. Verify before trusting any webhook payload.

// Node.js
const crypto = require("crypto");
const sig = crypto
  .createHmac("sha256", process.env.MUSEAI_WEBHOOK_SECRET)
  .update(rawBody)
  .digest("hex");
if (sig !== header["x-museai-signature"]) throw new Error("Invalid signature");