Channel Procurement, Quotas & Cost Alerting
Active procurement rules, account balance thresholds, discount verification, and multi-layer alerting for Volcengine Ark, Alibaba DashScope, and Kuaishou Kling.
Slloy routes generation workloads across three upstream model providers: Volcengine Ark (Seedream & Seedance), Alibaba Cloud DashScope (Qwen-Image & Wan), and Kuaishou Kling (Kling 3.0 & 4.0). This guide distills our active procurement policy, enterprise billing setup, and automated alerting architecture.
1. Core Procurement Decision
[!IMPORTANT] For Volcengine Ark and Alibaba Cloud DashScope, Slloy exclusively uses cash account balance with pay-as-you-go post-paid billing (
按量后付费). Do NOT purchase prepaid token packages, savings plans, or developer coding/agent subscriptions.
Why We Avoid Prepaid Packages & Coding Subscriptions on Ark / DashScope
- Prepaid Resource Packages Override Promotional Discounts:
- In Volcengine Ark, deduction priority is:
Free Quota -> Prepaid Resource Package -> Savings Plan -> Pay-as-you-go Post-paid (where promotional discounts apply). - Holding an active prepaid package for Seedance prevents calls from receiving official promotional discounts (e.g.,
25%offSeedance 2.0 fast,60%offSeedance 2.0 mini), and unused package quota expires as sunk cost.
- In Volcengine Ark, deduction priority is:
- Coding / Agent Plans Are Strictly Prohibited for Production APIs:
- Both Volcengine's Coding/Agent Plan and Alibaba Bailian's Token/Coding Plan explicitly prohibit multi-user production backend API usage in their Terms of Service. Using them risks immediate API key suspension.
- Kling Exception (Prepaid Resource Packs Only):
- Kuaishou Kling Open Platform does not offer pay-as-you-go post-paid billing; it sells prepaid credit packs (
5,000Kling credits =$700 ≈ ¥5,000, valid for180days, non-rollover,1Kling credit≈ ¥1). - Because unused Kling credits expire after
180days,server/src/pricing.ts(KLING_VIDEO_PRICE) always books Kling cost at full face value (¥1.00 / Kling credit) even if purchased at a10%bulk discount (30,000+credits), preventing sunk-cost underestimation.
- Kuaishou Kling Open Platform does not offer pay-as-you-go post-paid billing; it sells prepaid credit packs (
2. How to Verify Volcengine Ark Discounts & Billing
Check these four locations in order whenever auditing Seedance or Seedream unit costs:
- Official Model Pricing Table (Public Discount Tag):
- Volcengine Ark Docs (
https://docs.volcengine.com/docs/82379/1544106) -> Video Generation / Image Generation tables.
- Volcengine Ark Docs (
- Promotional Campaign Rules & Monthly Caps:
- Campaign rules page (
https://docs.volcengine.com/docs/82379/2630943) lists the promotional window and per-model monthly token cap (e.g.,1.2Btokens forSeedance 2.0 fast,3.6Btokens forSeedance 2.0 mini). Exceeding the cap silently reverts billing to list price.
- Campaign rules page (
- Console -> Billing Center -> Savings Plan -> Discount Query:
- Select
Doubao大模型-视频生成-Seedance2.0-fastto view the actual discount rate and remaining discounted quota on our specific enterprise account.
- Select
- Console -> Billing Center -> Bill Details (
账单明细):- URL:
https://console.volcengine.com/finance/bill/detail(syncs15–60minutes after generation). Enable the优惠类型 / 折扣columns to verify actual settled CNY per call.
- URL:
Procurement Review Triggers (When to Re-evaluate)
Re-evaluate whether to purchase a Volcengine Savings Plan only when all of the following hold:
- Monthly Ark spend consistently exceeds
¥3,000 / monthfor2consecutive months; or - Daily Ark spend exceeds
¥33 / day(B-1budget alert threshold); or - Monthly token usage approaches
70%of the promotional discount cap.
3. Cloud Console Budget & Balance Alerts
Configure the following two layers of alerts in the upstream provider consoles (and re-apply them immediately whenever rotating to a new enterprise account):
Volcengine Ark Console Alerts
- Layer 1 — CloudMonitor (
云监控) Minute-Level Spike Rules:- A-1 (Token Spike): Total model tokens in
5minutes> 500,000(catches runaway scripts or abuse before a¥150overnight burn like the2026-09-26incident). - A-2 (Call Count Spike): Total invocations in
5minutes> 60. - A-3 (Error Rate): Upstream error rate
> 25%over5minutes (catchesModelNotOpen, expired keys, or bad parameter deployments).
- A-1 (Token Spike): Total model tokens in
- Layer 2 — Billing Center (
费用中心) Budget & Balance Rules:- Daily Spend Alert (
B-1): Daily cost> ¥33 / day. - Monthly Budget (
2.2):¥300 / monthtotal budget, alert at80%(¥240). - Account Balance Floor (
2.3): Alert when cash balance drops below¥200(SMS + Email).¥200is also Volcengine Ark's minimum balance threshold required to activate new models in the console.
- Daily Spend Alert (
Alibaba Cloud DashScope Console Alerts
- Monthly Budget:
¥100 / monthin Alibaba Cloud Billing Center (费用中心 -> 预算管理), alert at80%(¥80). - Account Balance Floor: Alert when balance drops below
¥100.
4. Worker-Native Operational Alerting (opsAlert.ts & channelFaultAlert.ts)
In addition to upstream console budgets, Slloy runs automated health and channel fault checks directly inside the Cloudflare Worker:
5-Minute Cron Health Check (server/src/opsAlert.ts)
Executed at the end of every */5 * * * * Cron cycle (SWEEP_CRON in server/src/scheduled.ts):
Metric (OpsMetrics) | Threshold (THRESHOLDS) | Meaning & Action |
|---|---|---|
agedPendingImages | > 5 | Images still pending after the 10-minute sweeper just ran. Indicates imageSweeper.ts failed or queue backlog is stuck. |
agedPendingVideos | > 3 | Videos still pending for > 30 minutes. Indicates polling/sweeper failure or upstream task hang. |
failureRatePct (last 1h) | > 20% (min 10 samples) | Systemic upstream or R2 persistence outage over the last hour. |
timeoutRefunds24h (last 24h) | > 10 | Shadow indicator for Cloudflare Queue stalls, DLQ accumulation, or upstream 120s timeouts. |
- Behavior on Violation:
- Always emits a structured error log (
[ops-alert] event=violation ...) visible in Cloudflare Workers Logs and/adminoverview (opsHealth). - If
OPS_ALERT_EMAIL_TOis configured, acquires a cross-isolate database lock viarepo.hitRateLimit("ops-alert:email:<categories>", 1, cooldownSeconds)(default6hours /21,600scooldown) and sends an HTML summary email via Resend. - If sending the email fails,
clearCooldownreleases the rate-limit key so the next 5-minute cycle retries instead of silencing alerts for 6 hours.
- Always emits a structured error log (
Immediate Config Fault Alert (server/src/channelFaultAlert.ts)
When imageJobs.ts encounters a faultKind === "config" error (ModelNotOpen, Arrearage / insufficient balance, or 401/403 invalid API key), reportConfigFault() logs an immediate [channel-fault] error and dispatches a high-priority Resend alert (with its own per-provider/model cooldown) so operators can top up balance or activate the model in the console immediately.
Stripe Billing, Subscriptions & Risk Controls
Stripe Checkout lifecycle, 7 required webhook events, Basic $9.90 intro coupon, Customer Portal, checkout rate limits, 3DS rules, and automated dispute credit revocation.
Image Generation Pipeline, Queues & R2 Persistence
Accept-and-queue architecture via Cloudflare Queues, R2 temporary reference image offloading, pure-white product framing, magic-byte R2 persistence, and 10-minute zombie sweepers.