SuperAPI AI 工具集

autumn-modelling-pricing-plans

通用与其它

查看项目

更新于 10-16 07:16

技能介绍

该技能用于为 Autumn 设计定价模型,核心是编辑项目根目录下的 autumn.config.ts 配置文件,定义功能与套餐。

用途:规划定价层级、套餐与功能。涵盖设计定价分级、套餐、功能,以及计量与限制方式。

主要能力: 功能(feature)定义可被门控、计量或计费的对象。类型包括:boolean 开关;metered 计量(consumable 为 true 表示消耗型如消息、API 调用,false 表示持续性如席位、存储);credit_system 积分体系,通过 creditSchema 把多个计量功能映射为积分成本。可设置 eventNames 让多个功能响应同一事件。 套餐(plan)组合功能与价格形成订阅层级、加购项和充值。参数含 id、name、price(amount 与 interval)、items、autoEnable、addOn、freeTrial、group。价格周期包括 month、quarter、semi_annual、year、one_off;试用时长类型为 day、month、year。 套餐项(item)定义每个套餐包含的用量限制、价格与计费行为,含 featureId、included、unlimited、reset、price、proration、rollover。重置周期有 hour、day、week、month、quarter、semi_annual、year。 定价模式支持 usage_based(按用量)、prepaid(预付固定数量)、tiered(分层定价);价格字段有 amount、tiers、billingMethod、interval、billingUnits、maxPurchase。

必要用法:项目根目录若无 autumn.config.ts,运行 npx atmn init 登录并生成;已有配置需修改时先运行 atmn pull 同步。更新配置后先运行 atmn preview 校验并预览,将输出给用户确认后再运行 atmn push 同步到 Autumn;上线前先在沙箱模式测试,可用 atmn push -p 推送到生产。

限制与约定:功能和套餐 id 用小写加下划线;功能定义“可追踪什么”,套餐项定义“如何授予”,同一底层资源不得创建重复功能;带价格的套餐绝不设置 autoEnable: true,默认套餐必须免费;企业级自定义定价套餐不必写入配置,可在 Autumn 仪表盘按客户创建;货币在仪表盘 Developer > Stripe 更改;不确定的能力不要臆造,可查阅 Discord 或文档。