Paid, hosted product at menivor.com, now retired as a company project. Fresh squashed history of the cleaned working tree (secret-scanned, no .env, no customer data, no outreach logs). Built on MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
20 KiB
ReelForge provider marketplace and pay-as-you-go plan
Product direction: ReelForge becomes the unified video-generation layer for many model providers. Users do not buy fixed Starter/Pro render plans. They add prepaid USD-denominated wallet credit, choose a model/provider for a job capability, and pay the quoted provider price from their balance.
This is inspired by the operating model, not a code, brand, UI, or API clone of OpenRouter. OpenRouter’s official documentation currently describes USD credits, pass-through provider pricing, and a credit-purchase platform fee; its published rate is 5.5% with a $0.80 minimum. See its FAQ and pricing page.
1. Commercial model
1.1 One wallet, no forced subscriptions
- A wallet credit is one USD of spendable model usage, stored internally as
integer microdollars (
1 USD = 1,000,000 units), never a vague “one video” credit. - The user chooses the amount that reaches their wallet. A checkout quote adds a disclosed platform fee, payment-processing fee where applicable, tax, and the final charge.
- Providers/models are shown with their current unit price and the exact job estimate. We pass through the provider price unless a separately disclosed service surcharge is approved.
- No monthly plan is required. Optional later enterprise contracts can add invoicing, committed spend, dedicated capacity, and discounted fee schedules.
1.2 The user’s example
With a configurable 5% purchase fee and no tax/processor passthrough:
| Checkout line | Amount |
|---|---|
| Wallet credit requested | $20.00 |
| ReelForge platform fee (5%) | $1.00 |
| Payment processor/tax | quoted separately, if applicable |
| Card charge before tax/processor passthrough | $21.00 |
| Wallet balance after confirmed webhook | $20.00 |
The fee is not deducted from the $20 after purchase. The customer sees the wallet amount and total charge before confirming payment. Do not hard-code 5%: fee rate, minimum, maximum, jurisdiction tax behavior, and payment-rail surcharges are versioned configuration governed by finance/legal approval.
1.3 Revenue streams
- Credit-purchase platform fee — initial/default model.
- Optional BYOK routing fee — only after encrypted-key and consent controls; never charge it silently.
- Enterprise routing/SLA fee or negotiated committed-spend discount — later.
- Explicit value-add services such as storage retention or premium support — separate line items, never hidden in model price.
Provider revenue, processor fees, platform fee, tax, refunds, promotions, and manual adjustments must remain separate ledger reasons. A dashboard balance is derived from the ledger; it is never the accounting source of truth.
2. Product model catalog
2.1 What users choose
ReelForge lists only reviewed offerings. A listing has one capability and a unit model; it never exposes raw engine checkpoints or arbitrary provider URLs.
| Capability | Example selections | Metering unit |
|---|---|---|
| Script / reasoning | Claude, Gemini, OpenAI-compatible models | input/output/reasoning units or quoted operation |
| Voice | ElevenLabs voices/models, later alternatives | characters/seconds or provider quote |
| Avatar | HeyGen and approved alternatives | seconds/minutes or provider quote |
| B-roll / video | Comfy deployment, Pixelle-managed models, approved Wan routes | seconds/resolution/mode or provider quote |
| Image / cover | approved image provider/model | image/request/resolution |
| Music | approved music provider/model | seconds/request or provider quote |
Each listing shows: model name, provider, capability, supported inputs, output limits, region/data policy, price unit, estimated price range, latency band, availability state, and release status. The model catalog is a server product resource—not a static dropdown copied into clients.
2.2 Generation profile instead of scattered model fields
A reel spans script, voice, avatar, captions, composition, and optional B-roll. The user chooses a Generation Profile:
{
"profile_id": "creator-fast-v1",
"stages": {
"script": { "model_id": "anthropic/…" },
"voice": { "model_id": "elevenlabs/…" },
"avatar": { "model_id": "heygen/…" },
"broll": { "model_id": "pixelle/…" }
},
"routing": { "fallback": "none", "max_cost_usd": "2.50" }
}
At create time, the API resolves it to a versioned price and provider snapshot stored with the job. A later price/catalog update cannot alter an already accepted job. Users may opt into equivalent fallback routing; default is no substitute provider/model without consent.
3. Money and execution flow
1. User requests purchase quote($20 wallet credit)
2. API calculates fee/tax/processor quote + creates idempotent purchase intent
3. Payment provider checkout
4. Signed, idempotent webhook confirms payment
5. Wallet ledger: +$20 usable credit; fee/invoice retained separately
6. User selects profile/model and requests generation quote
7. API verifies entitlement, model availability, policy and balance
8. API locks/reserves the maximum quoted spend and creates one idempotent job
9. Worker calls the selected provider with correlation + price snapshot
10. Worker records normalized provider usage/cost
11. Settlement atomically charges actual cost and releases unused reservation
12. Failure/cancel before charge releases reservation; approved provider refund
creates a separate compensating wallet ledger entry
Required invariants
- Credit grants occur only from verified payment webhooks, never a browser success redirect.
- A job never dispatches before the max cost is reserved.
- Duplicate submit/webhook/provider callback cannot create two jobs or two wallet charges.
- Actual settlement cannot exceed the accepted maximum without a new user approval; fixed-price video tasks reserve the fixed quoted amount.
- Provider-reported usage, normalized cost, FX rate if any, catalog/price version, and correlation ID are retained for reconciliation.
- Refunds are append-only compensating entries; never mutate historical charge rows or silently change a balance.
- Wallet values use integer microdollars/decimal arithmetic, never floats.
4. API architecture additions
4.1 New domains
apps/api/app/domains/
├── catalog/
│ ├── router.py model/provider/profile browse and quote endpoints
│ ├── service.py catalog publication and price-version resolution
│ ├── repository.py
│ └── schemas.py
├── wallet/
│ ├── router.py balance, activity, purchase quote, checkout
│ ├── service.py reserve, settle, release, refund
│ ├── repository.py locked ledger writes and reconciliation queries
│ ├── policy.py fee/tax/limit/eligibility policy
│ └── schemas.py
├── routing/
│ ├── service.py provider/model selection and consented fallback
│ ├── providers/ normalized provider adapters
│ └── policy.py data-region, price-cap, availability constraints
└── byok/ later: encrypted customer provider credentials
billing remains responsible for payment-rail integration and invoice/webhook
verification. wallet becomes the durable user-spend accounting domain.
Existing fixed CreditLedger paths are migrated through an additive bridge:
old balance credits map to a documented opening wallet adjustment; no balance is
dropped or converted silently.
4.2 New durable records
| Record | Purpose |
|---|---|
wallet_accounts |
account/workspace currency and current derived balance cache |
wallet_ledger_entries |
immutable grant, reserve, settle, release, refund, fee, tax, adjustment events |
payment_intents |
checkout idempotency, quote snapshot, payment provider status |
provider_catalogs |
provider health, region, credential state, policy status |
model_catalog_entries |
provider model/capability metadata and availability |
price_versions |
effective price unit, currency, effective window, quote rules |
generation_profiles |
named stage-to-model selection owned by user/workspace or curated catalog |
usage_records |
normalized provider usage, cost, job/stage and correlation linkage |
provider_keys |
later BYOK encrypted credentials, scope, priority, audit state |
All money-affecting tables require migrations, append-only audit strategy, reconciliation tools, and retention rules. Finance/legal/tax review is required before live payments; this document is a software architecture plan, not tax or payments compliance advice.
4.3 Public API shape
GET /api/v1/catalog/models?capability=broll
GET /api/v1/catalog/models/{model_id}
GET /api/v1/catalog/profiles
POST /api/v1/catalog/quotes/generation
GET /api/v1/wallet
GET /api/v1/wallet/activity
POST /api/v1/wallet/purchase-quotes
POST /api/v1/wallet/checkout
POST /api/v1/wallet/webhooks/{payment_provider}
POST /api/v1/jobs # additive generation_profile_id + max_cost
POST /api/v1/generation/broll/generate # additive model_id + max_cost
GET /api/v1/jobs/{id}/usage
Responses include price currency/units, quote expiry, reservation state, accepted max cost, actual settled cost where known, and correlation ID. Existing generation inputs remain compatible while the old credit model is migrated.
5. Provider adapter contract
Every provider adapter conforms to one internal interface:
catalog() -> reviewed ModelListing[]
quote(request, price_version) -> max_cost + expiry
submit(request, snapshot, correlation_id) -> provider_run
poll(provider_run) -> state/progress/normalized_usage
cancel(provider_run) -> best effort
normalize_usage(provider_payload) -> UsageRecord
Adapters own outbound calls only. They cannot debit wallets, directly mutate jobs, or decide client price. The domain service owns the transaction, worker dispatch, reservation, settlement, retry, and refund behavior.
6. App changes and pages
Web — full marketplace/control plane
Add these feature folders and pages:
apps/web/src/features/
├── model-catalog/ model table/cards, compare, detail, availability
├── generation-profiles/ profile builder and saved profiles
├── wallet/ balance, purchase quote/checkout, activity, invoices
├── usage/ job/stage/model/provider cost drill-down
├── provider-keys/ BYOK settings (later, encrypted API flow only)
└── routing-policy/ fallback/data-policy/budget controls (workspace)
apps/web/app/
├── models/page.tsx
├── models/[modelId]/page.tsx
├── profiles/page.tsx
├── wallet/page.tsx
├── wallet/activity/page.tsx
├── wallet/success/page.tsx
├── wallet/cancel/page.tsx
├── usage/page.tsx
└── settings/providers/page.tsx # BYOK later
The Create and B-roll screens begin with a profile/model selector, display a fresh server quote and max-cost acknowledgement, then submit only the selected catalog ID. Checkout displays: wallet credit, platform fee, processor fee, tax, total, refund policy, and final wallet amount.
Mobile — spend-aware creation companion
- Add a compact model/profile picker to Create and B-roll.
- Add
WalletandActivityfrom the Me tab: balance, purchase handoff, recent charges/refunds, low-balance state. - Require an explicit quote confirmation sheet before expensive generation.
- Keep detailed model comparison, invoices, BYOK, and routing policy on web; mobile opens the web flow when needed.
Target files:
apps/mobile/src/features/model-catalog/
apps/mobile/src/features/wallet/
apps/mobile/src/shared/money/ # quote formatting; never fee calculation
apps/mobile/app/wallet.tsx
apps/mobile/app/wallet/activity.tsx
Desktop — native production workspace
- Add a reviewed model/profile picker to the Create and B-roll panels.
- Show quote, reservation, provider/model, cost cap, and final usage in Library/Preview details.
- Add a read-only Wallet section: balance and recent activity. Open browser for hosted checkout, invoices, OAuth, and later BYOK management.
- Keep payment provider credentials and all provider keys out of the desktop; the only locally stored secret remains the user API credential in OS secure storage.
Target modules:
apps/desktop/src/api/catalog.rs
apps/desktop/src/api/wallet.rs
apps/desktop/src/domain/profile.rs
apps/desktop/src/domain/wallet.rs
apps/desktop/src/ui/create/model_picker.rs
apps/desktop/src/ui/library/cost_details.rs
apps/desktop/src/ui/wallet/mod.rs
7. Delivery stages
Stage 0 — design and accounting proof
- Approve wallet definitions, fee schedule, tax/processor treatment, refund policy, provider price-source policy, and terms disclosure.
- Build catalog/price import tooling in shadow mode; compare quotes against provider invoices without charging users.
- Decide whether prices are pass-through, fee-on-purchase, or both by market.
Stage 1 — internal wallet for one fixed-price video route
- Enable wallet ledger, checkout quote, payment webhook, reservation/release, and activity history for allowlisted pilot users.
- Support one B-roll provider/model with a fixed per-clip quote.
- Reconcile every provider invoice line to one or more
usage_records.
Stage 2 — profiles and multi-provider video/voice
- Publish reviewed B-roll, voice, avatar, script, and music model listings.
- Add profile snapshots, per-stage quotes, max-cost caps, and opt-in fallback.
- Migrate legacy fixed render credits with a visible opening-balance record.
Stage 3 — public pay-as-you-go
- Enable public wallet top-up only after payment, refund, reconciliation, taxes, fraud/risk limits, and support playbooks are proved in pilot.
- Roll out providers one at a time with independent kill switches and published status/price pages.
Stage 4 — BYOK and workspace routing
- Encrypt customer keys with KMS-backed envelope encryption; never expose a stored key after entry; audit every use and allow immediate revoke.
- Add priority/fallback routing, workspace budgets, data-region policy, and enterprise invoice flows.
8. Do not do these
- Do not deduct a generic “one credit per video” after introducing variable provider costs.
- Do not use floats, mutable balance rows alone, browser redirects, or provider callbacks without signature verification for money changes.
- Do not allow a client to send an arbitrary model/provider/price; use catalog IDs and a server-created quote snapshot.
- Do not auto-fallback to a more expensive/different provider without the user/workspace policy and a max-cost cap.
- Do not put provider or payment credentials in web/mobile/desktop builds.
- Do not activate checkout until finance/legal, fraud, refund, tax, and payment webhook operations are ready.
9. OpenRouter integration and open-source intake
9.1 Correct reuse boundary
OpenRouter publishes open-source SDKs, provider integrations, and examples, but the public repositories do not establish that its production multi-provider router, wallet, provider contracts, risk system, or billing backend is available to copy. Treat it as a product/API dependency and a source of public protocol ideas—not as a backend to fork.
Useful upstream references include:
- OpenRouter Python SDK, whose repository advertises Apache-2.0 licensing;
- OpenRouter TypeScript SDK, whose repository advertises Apache-2.0 licensing;
- OpenRouter examples, whose repository advertises MIT licensing; and
- the AI SDK provider adapter, which is useful for browser/server integration patterns but is not a ReelForge routing implementation.
Before use, an engineer must pin a commit/tag, verify the LICENSE in that exact
revision, review transitive dependencies and terms, register it in
external/REGISTRY.md, and decide whether to use it as a dependency, a small
adapted snippet with attribution, or an implementation reference only. Never
copy a folder just because it is visible on GitHub.
9.2 OpenRouter is one upstream provider gateway
ReelForge can route selected text/image/video-capable calls through OpenRouter, but it remains an adapter under our own catalog/routing/wallet contract:
user model selection
│
ReelForge catalog + quote + wallet reservation
│
routing policy
├── direct Anthropic / Google / ElevenLabs / HeyGen / Comfy/Pixelle adapter
└── OpenRouter gateway adapter ── OpenRouter API ── selected upstream model/provider
│
normalized usage, provider metadata, cost, result
│
ReelForge wallet settlement + job record
The customer sees a model, route, price source, data policy, and fallback
setting. For example, google/gemini-video may be direct Google capacity or an
OpenRouter gateway route; they are separate catalog entries because uptime,
terms, latency, data handling, and ReelForge cost can differ.
OpenRouter routing concepts worth implementing independently are reviewed provider order, fallback opt-in, capability filtering, data-retention/region constraints, and price/latency/throughput preferences. Its current routing documentation describes these controls and price/uptime-aware selection: Provider Routing. ReelForge begins with deterministic user-selected routes; automatic fallback is introduced only with an equivalent-output policy and accepted max-cost cap.
9.3 Provider adapter source plan
apps/api/app/platform/providers/
├── base.py ProviderAdapter protocol and normalized errors
├── catalog.py catalog ingestion, model IDs, capability checks
├── pricing.py quote normalization and price-version snapshots
├── health.py provider health/availability observations
├── openrouter/
│ ├── client.py pinned official SDK or small HTTP client
│ ├── catalog.py OpenRouter catalog → reviewed internal listings
│ ├── adapter.py quote/submit/poll/usage normalization
│ └── mapping.py OpenRouter model/provider → ReelForge IDs
├── anthropic/
├── google/
├── elevenlabs/
├── heygen/
├── comfyui_deploy/
└── pixelle/
app/domains/routing/providers/ can re-export those adapters for domain use;
there must be one source of the outbound protocol code. apps/web, apps/mobile,
and apps/desktop never import an SDK or provider folder.
9.4 Pricing when the route uses OpenRouter
ReelForge has two independent commercial relationships:
- ReelForge ↔ its upstream — direct provider invoice or OpenRouter wallet/ invoice; this is ReelForge cost of goods.
- User ↔ ReelForge — a ReelForge wallet purchase, e.g. $20 usable balance plus a clearly disclosed $1 5% platform fee.
Do not imply that a user’s ReelForge credit purchase buys OpenRouter credit in their name. If OpenRouter itself charges ReelForge a credit-purchase fee, decide explicitly whether to absorb that procurement cost or include it in a published route price; do not add a hidden second fee at settlement. Every catalog quote must identify its price source and effective date.
9.5 External intake queue
| Priority | Candidate | Intended use | Admission bar |
|---|---|---|---|
| 1 | OpenRouter SDK/examples | protocol client, usage/cost metadata patterns | exact license/tag + dependency review |
| 2 | Direct official provider SDKs | native provider adapter implementations | official package/license + secret isolation |
| 3 | external/comfyui-deploy |
B-roll deployment integration | existing registry approval + immutable workflow manifest |
| 4 | ComfyUI/Wan/VideoTuna/VideoX-Fun/Wan2GP/hyvideo | evaluation/model capability only | model-weight license, security, GPU image, owner, manifest approval |
| 5 | Any community provider adapter | optional future route | legal/security review; no unvetted code in production image |
No external project is placed in a production image or client dependency until
the admission bar is met. The existing external/REGISTRY.md is the required
record of upstream URL, pinned commit, license, purpose, runtime status, weight
license, security owner, and approval state.