BLACKFRIDAY 来了!

    领取40%优惠
    Armox
    Armox Academy 📚
    介绍
    快速入门指南
    理解Brain
    节点
    AI模型
    画布编辑器
    训练 LoRA
    Train MiniMax H3 LoRA
    提示词工程
    Nano Banana ProFlux模型视频提示词音频提示词
    文本节点
    图像节点
    视频节点
    音频节点
    上传节点
    工具节点
    Academy.canvas3dNodes
    连接节点
    运行工作流
    什么是应用?
    创建您的第一个应用
    运行应用
    创意人士的应用创意
    API 参考入门
    身份验证模型端点应用端点任务端点账户端点Webhook错误与速率限制
    图库
    下载与导出
    使用AI聊天
    与AI进行头脑风暴
    文本模型
    GPT-5.4Gemini 3.1 ProClaude Opus 4.6GPT-5Gemini 2.5 FlashClaude 4.5 SonnetDeepSeek V3.1Grok 4Llama 3 70BLlama 3 8B
    图像模型
    Nano BananaNano Banana 2Nano Banana ProGPT Image 2.5Flux 2 ProKrea 2 LargeKrea 2 MediumFlux 2 FlexFlux 2 DevFlux 1.1 Pro UltraGrok ImagineFlux Kontext MaxFlux Kontext ProSeedream 4Seedream 4.5Wan 2.2 ImageQwen ImageQwen Image Edit AnglesStable Diffusion XLGrok 2 ImageGen4 Image
    视频模型
    Kling V2.5 Turbo ProKling 2.6 ProGrok VideoVeo 3.1Veo 3.1 FastSeedance 1 ProSeedance 1 Pro FastSeedance 1 LiteSeedance 2.0Wan 2.6 I2VWan 2.6 T2VWan 2.5 I2VWan 2.5 T2VSora 2 ProSora 2Hailuo 2.3Hailuo 2.3 FastVideo-01 DirectorGen4 Aleph
    音频模型
    MusicGenMusic 1.5Music-01Lyria 2Speech-02 TurboSpeech-02 HDVoice CloningXTTS-v2
    工具模型
    Topaz Image UpscalerPrunaAI UpscaleCrystal UpscalerRemove BackgroundFace SwapImage FiltersProfessional HeadshotText RemovalInpaintAdd WatermarkVideo Upscale (Runway)Video Upscale (Topaz)Video Upscale (Bytedance)Lip Sync ProAuto CaptionReplace CharacterMotion Transfer
    Academy.models3d
    Hunyuan3D V3
    社交媒体内容
    产品摄影
    营销活动
    视频制作
    音频与音乐
    多步骤工作流
    图像到图像
    一致风格
    积分优化
    常见错误
    键盘快捷键
    示例画廊
    提示词库
    Seedance 2.0 for AEC
    企业版概述
    管理员控制台
    申请积分
    常见问题
    理解积分
    故障排除
    API 参考API 参考入门Webhook
    Copy to LLM

    Webhooks

    Webhooks let your system receive job completion events without continuous polling.


    How to Enable Webhooks

    Include webhook_url in your run request:

    • POST /api/v1/models/run
    • POST /api/v1/apps/run

    Example:

    {
      "model": "google/nano-banana",
      "input": { "prompt": "..." },
      "webhook_url": "https://your-app.com/webhooks/armox"
    }
    

    Delivery Format

    Armox sends:

    • Method: POST
    • Header: X-Armox-Signature: sha256=<signature>
    • Content-Type: application/json

    Payload shape:

    {
      "event": "job.completed",
      "job": {
        "id": "job_456",
        "status": "completed",
        "output": {
          "outputImage": "https://..."
        },
        "completed_at": "2026-03-26T12:45:00.000Z"
      }
    }
    

    Signature Verification (Node.js)

    import crypto from "crypto";
    
    export function verifyArmoxSignature(rawBody, signatureHeader, secret) {
      if (!signatureHeader || !signatureHeader.startsWith("sha256=")) return false;
    
      const received = signatureHeader.slice("sha256=".length);
      const expected = crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
    
      try {
        return crypto.timingSafeEqual(Buffer.from(received), Buffer.from(expected));
      } catch {
        return false;
      }
    }
    

    Signature Verification (Python)

    Prompt Template
    import hmac
    import hashlib
    
    def verify_armox_signature(raw_body: bytes, signature_header: str, secret: str) -> bool:
        if not signature_header or not signature_header.startswith("sha256="):
            return False
    
        received = signature_header[len("sha256="):]
        expected = hmac.new(
            key=secret.encode("utf-8"),
            msg=raw_body,
            digestmod=hashlib.sha256
        ).hexdigest()
    
        return hmac.compare_digest(received, expected)

    Best Practices

    • verify signature before processing payload
    • use raw request body for signature verification
    • process events idempotently (dedupe by job.id)
    • return 2xx quickly
    • move heavy processing to background workers
    • keep retry-safe webhook handlers

    Suggested Handling Flow

    1. Receive webhook request
    2. Verify X-Armox-Signature
    3. Validate JSON payload
    4. Upsert job status in your database
    5. Trigger downstream workflow (notification, asset indexing, etc.)
    6. Return 200 quickly

    Polling + Webhooks Together

    For best reliability, use both:

    • webhook as primary event source
    • periodic reconciliation polling as fallback

    See polling patterns in Jobs Endpoint.

    Related Pages

    • Jobs Endpoint
    • Errors & Rate Limits
    上一页账户端点
    下一页错误与速率限制

    准备好转变 您的创意工作流了吗?

    无需信用卡500免费积分

    本页内容

    How to Enable WebhooksDelivery FormatSignature Verification (Node.js)Signature Verification (Python)Best PracticesSuggested Handling FlowPolling + Webhooks TogetherRelated Pages