# AI Editor RSP pricing/credits 经济模型与付费墙合同

- task_id: t_a4b774db
- project: aieditorrsp.net
- production_url: https://aieditorrsp.net
- date_utc: 2026-06-05
- owner_feedback_basis: `/root/.hermes/image_cache/img_23a772647481.jpg`, `/root/.hermes/image_cache/img_f5a86dccf369.jpg`
- verdict: PRICING_CONTRACT_REDO_REQUIRED

## 1. 结论

当前生产 pricing/credits 不能放行：

1. 公开 pricing 把 `$9 / 100 credits` credit pack 与 `$19 / 200 credits` Pro 并列，pack 单价 $0.09/credit，Pro 单价 $0.095/credit，用户会理性选择 pack，订阅转化被反向锚定。
2. 生产 pricing 只有 Free / Pro Monthly / Credit Pack，没有年付 toggle，也没有 Business/Team 价格锚点，不符合默认三档 SaaS/AI 工具站合同。
3. 0 credits 状态仍给多个同权入口：Upgrade / Buy credit pack / Billing options 或 Sign in / Upgrade / Pricing；主转化 CTA 不干净。
4. 用户看不到“每次生成消耗 1 credit；失败不扣；不同模板是否同价；HD/批量是否加价”的明确规则。
5. 代码与 API 目前把 `credit_pack` 作为可 checkout plan 暴露给匿名/免费用户；这与订阅优先经济模型冲突。

建议立即改成：Free / Pro / Business 三档；credit pack 从公开主套餐降级为 Pro 用户的 add-on。非 Pro 0 credits 只保留一个主 CTA：Upgrade to Pro。

## 2. 生产站复验证据

### 2.1 浏览器复验：/pricing

Browser URL: `https://aieditorrsp.net/pricing`

生产可见文案：
- Free: `$0`, `2 anonymous generations per day`
- Pro Monthly: `$19`, `per month · 200 credits`
- Credit Pack: `$9`, `one-time · 100 credits`
- Credit panel: `UPGRADE TO PRO`, `BUY CREDIT PACK`, `SIGN IN`

问题：credit pack 被放在公开 pricing 三栏，与 Pro 同级竞争。

### 2.2 生产 API：/api/credits

`GET https://aieditorrsp.net/api/credits` 返回 200，匿名状态核心字段：

```json
{
  "authenticated": false,
  "plan": "free",
  "state": "anonymous",
  "daily_limit": 2,
  "free_remaining": 2,
  "paid_remaining": 0,
  "credits_remaining": 2,
  "paid_enabled": true,
  "checkout": {
    "monthly": "/api/checkout/stripe?plan=monthly",
    "yearly": "/api/checkout/stripe?plan=yearly",
    "credit_pack": "/api/checkout/stripe?plan=credit_pack"
  }
}
```

问题：匿名可见 `credit_pack` checkout 路径，虽然 checkout route 会要求登录，但产品心智仍是“可以一次性买包，不必订阅”。

### 2.3 生产 checkout：未登录会被拦

`HEAD/GET https://aieditorrsp.net/api/checkout/stripe?plan=monthly` 当前未登录返回 401/登录要求，这是正确方向；但 pricing UI 和 API action_card 仍暴露 credit pack。

## 3. 代码证据

- `src/app/api/generate-image/route.ts:236-263`, `371-388`
  - 只有 provider 成功并返回 usable result 后调用 `commitCredit`。
  - 每次成功生成固定写入 `credits_used = 1`。
  - response 返回 `credits_charged: 1`。
- `src/app/api/generate-image/route.ts:216-224`
  - 登录用户扣款顺序：monthly credits -> purchased credits -> free_daily。
- `src/app/api/generate-image/route.ts:227-233`
  - 匿名用户按 IP+date 享受 free daily quota。
- `src/app/api/checkout/stripe/route.ts:5-9`
  - monthly 200 credits；yearly 200 credits；credit_pack 100 credits。
- `src/app/api/checkout/stripe/route.ts:69-75`
  - Stripe Checkout 已包含 `automatic_tax[enabled]=true`、`billing_address_collection=required`、`tax_id_collection[enabled]=true`、credits metadata。
- `src/app/api/webhooks/stripe/route.ts:20-38`
  - `credit_pack` 增加 purchased_credits；subscription 重置 monthly_credits=200 并把用户 plan 设为 pro。
- `src/components/PublicPages.tsx:7-37`
  - 公开 pricing 当前三栏是 Free / Pro Monthly / Credit Pack。
- `src/components/CreditAccountPanel.tsx:63-66`
  - account panel 固定展示 Upgrade / Buy credit pack / Sign in 或 Billing options。
- `src/app/api/credits/route.ts:69-83` 与 `src/app/api/generate-image/route.ts:28-45`
  - quota exhausted action_card 对免费/登录用户都给多个入口，且给 credit_pack 次级入口。

## 4. 竞品定价参考

| 竞品 | Free | 主付费 | 高阶/团队 | 对 AI credits 的启发 |
|---|---:|---:|---:|---|
| Canva | Free 有有限 AI allowance | Pro 约 $12.99/月或 $120/年；官方页面也显示 Free up to 200 Standard AI / 20 Premium AI uses，Pro 10x Free | Business/Enterprise | Free 给可感知额度；付费主卖订阅，不把一次性包放成主套餐 |
| Photoroom | Free 有有限导出与 AI access | Pro / Max / Ultra 分层；Pro 500 batch exports，AI credit allowance 5x Free；Max 3x Pro | Enterprise custom | 用套餐层级卖更多额度/模型/批量，不让 pack 抢主订阅 |
| Adobe Firefly | Free/Creative Cloud plans 含 monthly credits | Firefly paid plans / add-on plans | Business 联系 account manager | credit add-on 是“run out 后继续创作”的补充，不是默认替代订阅 |
| fal FLUX.1 Kontext [pro] | N/A | API 成本 $0.04/image | Kontext max/ultra 更贵 | 本站每成功生成 1 credit 的边际成本按 $0.04 估算 |

## 5. 成本模型

核心假设：
- 当前生产 provider: `fal-ai/flux-pro/kontext` 或 fallback replicate；主成本按 fal 官方 `$0.04/image`。
- 当前产品只有单图 preview edit；所有模板同成本。
- 当前代码只在 provider 成功返回图片后扣 1 credit，失败不扣站内 credits。
- Cloudflare Workers/D1/R2 在当前流量下可先按 $20/月固定缓冲计；后续高流量再复核。
- Stripe fee 按 2.9% + $0.30 估算，税款不计收入。

### 单套餐毛利

| 项 | 价格 | credits | 单价/credit | Stripe fee | provider 成本 | 满额毛利 | 满额毛利率 |
|---|---:|---:|---:|---:|---:|---:|---:|
| Pro monthly | $19 | 200/月 | $0.095 | $0.85 | $8.00 | $10.15 | 53.4% |
| Pro yearly 等效月 | $15 | 200/月 | $0.075 | $0.73 | $8.00 | $6.27 | 41.8% |
| 当前 pack | $9 | 100 | $0.090 | $0.56 | $4.00 | $4.44 | 49.3% |
| 推荐 add-on pack | $15 | 100 | $0.150 | $0.73 | $4.00 | $10.27 | 68.4% |

判断：当前 `$9/100` 比 Pro 月付更便宜，且没有持续承诺，必须下线公开主入口。若保留 pack，应改为 Pro add-on，价格不低于 `$15/100`。

### ROI 场景（按 Pro monthly，满额使用的保守成本）

| 场景 | UV/天 | 月访客 | 付费转化 | 付费用户 | 月收入 | Stripe | 付费 API 成本 | 免费 API 成本 | 固定缓冲 | 净利 |
|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|
| conservative | 100 | 3,000 | 1.5% | 45 | $855 | $38.30 | $360.00 | $14.40 | $20 | $422.31 |
| base | 300 | 9,000 | 2.5% | 225 | $4,275 | $191.47 | $1,800.00 | $51.84 | $20 | $2,211.69 |
| optimistic | 1,000 | 30,000 | 3.5% | 1,050 | $19,950 | $893.55 | $8,400.00 | $216.00 | $20 | $10,420.45 |

盈亏平衡：按 $20/月固定缓冲，Pro monthly 满额使用也只需约 2 个付费用户覆盖固定成本。但这不代表可以放松额度；真正风险是 credit pack 反向锚定和滥用。

## 6. 推荐套餐

### Free

- 价格：$0
- 额度：2 successful preview edits / day
- 消耗：每次成功生成 1 credit；provider 失败、unsafe prompt block、上传/格式失败不扣。
- 功能：编辑器、Prompt Library、4 个基础模板、下载结果。
- 限制：无批量、无 HD、无历史库、无优先队列。
- CTA：Start editing / Upgrade to Pro when exhausted。

### Pro

- 月付：$19/month
- 年付：$180/year，前台显示 `$15/mo billed annually`，Save 21%。
- 额度：200 credits / billing month。
- 消耗：当前所有模板 1 credit / successful image edit。
- 未来规则：HD export = 2 credits；batch = 每张成功结果 1 credit；若 batch+HD，按每张 2 credits。
- 过期：monthly subscription credits expire/reset at next billing cycle，不 rollover。
- 叠加：purchased add-on credits 单独计入 `purchased_credits`，优先级低于 monthly credits；可 rollover 12 months，取消订阅后已购 add-on credits 保留至到期，但不能再新买 add-on。
- CTA：Upgrade to Pro / Start yearly。

### Business / Team

- 价格：Contact us / Join waitlist。
- 不接真实 checkout，直到 team workspace、seat、invoice、admin、共享素材库实现。
- 承诺：custom monthly credits、team billing、priority support、brand/workflow support。
- CTA：Contact / Join waitlist。

### Credit add-on pack

默认不作为公开第三套餐，不给匿名/Free 用户独立购买。

推荐规则：
- 可见对象：active Pro users only，且 preferably only when monthly credits < 20 或 exhausted。
- 价格：$15 / 100 add-on credits。
- 过期：12 months after purchase。
- 叠加：可叠加到 `purchased_credits`。
- 消耗顺序：monthly credits -> purchased credits -> free daily；如果希望减少订阅浪费，也可改成 free daily -> monthly -> purchased，但需全站统一。
- UI：只作为 Pro 用户 quota panel 的 secondary link，不进入公开 pricing 主卡。

若业务坚持 standalone pack：最低也应改成 $15/100，并把文案写成 occasional trial pack；但不推荐，因为会削弱 ARR。

## 7. 0 credits 付费墙合同

### 匿名用户 0 credits

主 CTA 只留一个：
- `Sign in to continue`

次级文字链接：
- `See Pro pricing`

不展示：
- Buy credit pack
- Billing options
- 三个同权按钮

文案：
> You used today’s 2 free preview edits. Sign in to continue with Pro credits.

### 已登录 Free 用户 0 credits

主 CTA 只留一个：
- `Upgrade to Pro`

次级文字链接：
- `View plan details`

不展示：
- Buy credit pack
- Contact / Billing options 同权按钮

文案：
> You’re out of free edits. Pro includes 200 successful edits each month. Failed provider calls never consume credits.

### Pro 用户 0 monthly credits

主 CTA：
- `Buy 100 add-on credits · $15`

次级链接：
- `Switch to yearly` 或 `Contact us for team volume`

文案：
> Your monthly Pro credits are used. Add 100 credits for this account, valid for 12 months.

## 8. 下游实现要求

1. Pricing 页面改为 Free / Pro / Business 三档。
2. 增加 monthly/yearly billing toggle；默认突出 yearly，显示 `$15/mo billed annually` 和 `Save 21%`。
3. Credit pack 从公开 pricing 主卡移除；只在 Pro account panel 或 quota exhausted for Pro 显示。
4. `/api/credits` 不应对匿名/Free 暴露 `checkout.credit_pack` 或 `buy_credit_pack` 推荐动作。
5. `/api/checkout/stripe?plan=credit_pack` 增加 user plan gate：非 active Pro 返回 403/redirect pricing，不创建 Stripe Session。
6. action_card 按用户状态返回单主 CTA，不要把 Sign in / Upgrade / Pack / Pricing 做成同权按钮。
7. 在 pricing FAQ 和 editor quota card 明确：`1 successful image edit = 1 credit`；failed provider call 不扣；当前模板同价；HD/batch 尚未开放。
8. Stripe Checkout 保持：automatic_tax enabled、billing address required、tax ID collection enabled；税款记 tax payable，不计收入。

## 9. Machine-readable pricing_contract

```json
{
  "project": "aieditorrsp",
  "version": "2026-06-05.t_a4b774db",
  "currency": "USD",
  "public_plan_count": 3,
  "primary_paid_plan": "pro",
  "billing_toggle": {
    "enabled": true,
    "default": "yearly",
    "monthly_label": "$19/mo",
    "yearly_label": "$15/mo billed annually",
    "yearly_price": 180,
    "yearly_discount_percent": 21
  },
  "plans": [
    {
      "id": "free",
      "name": "Free",
      "price_monthly": 0,
      "public": true,
      "checkout_enabled": false,
      "entitlement_implemented": true,
      "limits": {
        "successful_edits_per_day": 2,
        "credits_per_successful_edit": 1,
        "templates": ["editorial", "product", "social", "cyberpunk"],
        "hd_export": false,
        "batch": false
      },
      "cta": "Start editing"
    },
    {
      "id": "pro",
      "name": "Pro",
      "price_monthly": 19,
      "price_yearly": 180,
      "public": true,
      "checkout_enabled": true,
      "checkout_plans": ["monthly", "yearly"],
      "entitlement_implemented": true,
      "limits": {
        "monthly_credits": 200,
        "credits_per_successful_edit": 1,
        "monthly_credits_rollover": false,
        "failed_provider_calls_charge_credits": false,
        "unsafe_prompt_or_validation_failures_charge_credits": false,
        "future_hd_export_credits": 2,
        "future_batch_credits": "1 credit per successful output image; 2 credits per output if HD"
      },
      "cta": "Upgrade to Pro"
    },
    {
      "id": "business",
      "name": "Business / Team",
      "price_mode": "contact_sales",
      "public": true,
      "checkout_enabled": false,
      "entitlement_implemented": false,
      "business_cta_mode": "contact_or_waitlist",
      "limits": {
        "monthly_credits": "custom",
        "seats": "future",
        "team_workspace": "future",
        "invoice_billing": "future"
      },
      "cta": "Contact us"
    }
  ],
  "credit_pack_policy": {
    "standalone_public_purchase": false,
    "recommended_visibility": "pro_addon_secondary_only",
    "eligible_user_states": ["pro_paid", "pro_exhausted"],
    "checkout_plan": "credit_pack",
    "price": 15,
    "credits": 100,
    "price_per_credit": 0.15,
    "expires_after_days": 365,
    "rollover": true,
    "stackable": true,
    "consumption_order": ["monthly_credits", "purchased_credits", "free_daily"],
    "non_pro_checkout_behavior": "403_or_redirect_to_pricing_without_stripe_session"
  },
  "credit_metering": {
    "current_templates_same_price": true,
    "credits_per_successful_generation": 1,
    "charged_only_after_provider_success": true,
    "failed_provider_call_charged": false,
    "upload_validation_failure_charged": false,
    "unsafe_prompt_block_charged": false,
    "current_hd_or_batch_available": false,
    "future_hd_credits": 2,
    "future_batch_credits_formula": "successful_outputs * (hd ? 2 : 1)"
  },
  "paywall": {
    "anonymous_exhausted": {
      "primary_cta": { "label": "Sign in to continue", "href": "/api/auth/login?return_to=/ai-photo-prompt-editor" },
      "secondary_links": [{ "label": "See Pro pricing", "href": "/pricing" }],
      "forbidden_ctas": ["buy_credit_pack", "billing_options"]
    },
    "free_signed_in_exhausted": {
      "primary_cta": { "label": "Upgrade to Pro", "href": "/api/checkout/stripe?plan=monthly" },
      "secondary_links": [{ "label": "View plan details", "href": "/pricing" }],
      "forbidden_ctas": ["buy_credit_pack_as_primary", "multiple_equal_buttons"]
    },
    "pro_exhausted": {
      "primary_cta": { "label": "Buy 100 add-on credits · $15", "href": "/api/checkout/stripe?plan=credit_pack" },
      "secondary_links": [{ "label": "Switch to yearly", "href": "/pricing#yearly" }, { "label": "Contact us for team volume", "href": "/contact" }]
    }
  },
  "checkout_enabled_plans": ["pro_monthly", "pro_yearly"],
  "entitlement_implemented_plans": ["free", "pro_monthly", "pro_yearly", "pro_addon_credit_pack"],
  "cost_guardrail": {
    "provider": "fal-ai/flux-pro/kontext",
    "estimated_provider_cost_per_successful_edit": 0.04,
    "free_daily_limit": 2,
    "pro_monthly_credits": 200,
    "pro_monthly_full_usage_provider_cost": 8.0,
    "pro_monthly_full_usage_gross_margin_after_stripe_and_provider": 10.15,
    "minimum_credit_pack_price_if_enabled": 15
  },
  "tax_requirements": {
    "stripe_tax_required": true,
    "checkout_session_params": {
      "automatic_tax[enabled]": true,
      "billing_address_collection": "required",
      "tax_id_collection[enabled]": true
    },
    "accounting": {
      "tax_not_revenue": true,
      "store_fields": ["subtotal", "tax", "total", "tax_payable"]
    },
    "merchant_of_record": "Nextfield Labs LLC remains operator; Stripe is payment processor, not MoR"
  },
  "implementation_blockers": [
    "Remove public Credit Pack pricing card",
    "Add yearly billing toggle and Business waitlist card",
    "Gate credit_pack checkout to active Pro users",
    "Return single-primary-CTA action_card per exhausted state",
    "Add visible 1 successful edit = 1 credit disclosure"
  ]
}
```
