railyard/apps/rago/seeds/autogtm.json
caelum0x dba63e5f79 feat(rago): Rally plan and seat mirror metrics in the autogtm seed
Adds rally_plan_event (count_agg) and rally_seats (max_agg over seats) plus
the $0 rally_plan_mirror plan that vcglass subscribes each Rally account to
when mirroring plan and seat changes. Creem stays the payment rail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 05:01:39 +03:00

191 lines
7.6 KiB
JSON

{
"consumer": "autogtm",
"description": "Rago catalog seed for Rally AutoGTM (vcglass, ex-VCPeer cold email / GTM automation). Meters outbound cold emails, AI-generated drafts, and credited card top-ups. Two plans: `gtm_usage` (the plan vcglass subscribes a project to by default, RAGO_GTM_PLAN_CODE; $0 metering mirror, because customers are charged through the local Creem balance) and `autogtm_growth` (flat monthly seat plus metered usage, for tenants billed by Rago directly). Also mirrors Relay LLM spend (`relay_llm_usage`) at $0; the Relay route for the Rally gateway key points at this org. Rally plan lifecycle and seat counts mirror into `rally_plan_event` and `rally_seats` on the $0 `rally_plan_mirror` plan (one mirror subscription per Rally account).",
"currency": "USD",
"billable_metrics": [
{
"name": "GTM Emails Sent",
"code": "gtm_email_sent",
"description": "One event per cold/outbound email actually handed to the sending transport (Postal). Counted, not summed.",
"aggregation_type": "count_agg",
"recurring": false
},
{
"name": "GTM AI Drafts",
"code": "gtm_draft",
"description": "One event per AI-generated email/sequence draft produced by the decisions engine. Counted regardless of whether the draft is later sent.",
"aggregation_type": "count_agg",
"recurring": false
},
{
"name": "GTM Card Top-ups",
"code": "gtm_topup",
"description": "One event per card top-up credited to a project's local balance (vcglass lib/autogtm/rago-billing.ts meterRagoTopup, sent only when RAGO_GTM_TOPUP_METERING=1). Sums `properties.amount_cents`. Audit metric: the customer already paid through Creem, so every plan charges it at $0.",
"aggregation_type": "sum_agg",
"field_name": "amount_cents",
"recurring": false
},
{
"name": "Relay LLM Spend",
"code": "relay_llm_usage",
"description": "One event per LLM inference routed through Railyard Relay (Relay cost feed, RELAY_COST_FEED_FORMAT=rago; transaction_id = Relay event id). Sums `properties.charged_micros` (retail spend in micro-USD). Properties also carry model, route, input/output/total tokens, charged_usd and settlement.",
"aggregation_type": "sum_agg",
"field_name": "charged_micros",
"recurring": false
},
{
"name": "Rally Plan Events",
"code": "rally_plan_event",
"description": "One event per Rally plan transition (activated, renewed, updated, past_due, cancelled, expired) for founder plans (Creem) and VC tiers, sent by vcglass lib/railyard/plan-mirror.ts when RAGO_URL + RAGO_API_KEY are set. Counted. Properties carry plan, state, provider, account_kind and, when known, amount_cents, billing_cycle and seat_limit. Audit metric: the payment rail already charged the customer.",
"aggregation_type": "count_agg",
"recurring": false
},
{
"name": "Rally Seats",
"code": "rally_seats",
"description": "One event per Rally seat change (VC team seats, agency client-viewer seats) carrying `properties.seats` = seats in use after the change. max_agg, so a period reports its peak seat count.",
"aggregation_type": "max_agg",
"field_name": "seats",
"recurring": false
}
],
"plans": [
{
"name": "AutoGTM Usage",
"code": "gtm_usage",
"interval": "monthly",
"description": "Default plan vcglass subscribes each project to. $0 base and $0 charges: Rago mirrors usage (emails, drafts, top-ups) for the billing page and allowance checks; the money moves through the project's Creem-funded balance.",
"amount_cents": 0,
"amount_currency": "USD",
"pay_in_advance": false,
"bill_charges_monthly": true,
"charges": [
{
"billable_metric_code": "gtm_email_sent",
"charge_model": "standard",
"invoiceable": true,
"properties": {
"amount": "0"
}
},
{
"billable_metric_code": "gtm_draft",
"charge_model": "standard",
"invoiceable": true,
"properties": {
"amount": "0"
}
},
{
"billable_metric_code": "gtm_topup",
"charge_model": "standard",
"invoiceable": true,
"properties": {
"amount": "0"
}
},
{
"billable_metric_code": "relay_llm_usage",
"charge_model": "standard",
"invoiceable": true,
"properties": {
"amount": "0"
}
}
]
},
{
"name": "AutoGTM Growth",
"code": "autogtm_growth",
"interval": "monthly",
"description": "Flat monthly platform fee plus metered email volume and AI draft generation.",
"amount_cents": 4900,
"amount_currency": "USD",
"pay_in_advance": true,
"bill_charges_monthly": true,
"charges": [
{
"billable_metric_code": "gtm_email_sent",
"charge_model": "package",
"invoiceable": true,
"properties": {
"amount": "8.0",
"package_size": 1000,
"free_units": 2000
}
},
{
"billable_metric_code": "gtm_draft",
"charge_model": "standard",
"invoiceable": true,
"properties": {
"amount": "0.02"
}
},
{
"billable_metric_code": "gtm_topup",
"charge_model": "standard",
"invoiceable": true,
"properties": {
"amount": "0"
}
},
{
"billable_metric_code": "relay_llm_usage",
"charge_model": "standard",
"invoiceable": true,
"properties": {
"amount": "0"
}
}
]
},
{
"name": "Rally Plan Mirror",
"code": "rally_plan_mirror",
"interval": "monthly",
"description": "Mirror subscription vcglass creates once per Rally account (user, VC firm, agency) with external id rally-mirror-<kind>-<id> (RAGO_RALLY_PLAN_CODE). $0 base and $0 charges: plan lifecycle and seat counts are visible in Rago while Creem and the VC checkout stay the payment rails.",
"amount_cents": 0,
"amount_currency": "USD",
"pay_in_advance": false,
"bill_charges_monthly": true,
"charges": [
{
"billable_metric_code": "rally_plan_event",
"charge_model": "standard",
"invoiceable": true,
"properties": {
"amount": "0"
}
},
{
"billable_metric_code": "rally_seats",
"charge_model": "standard",
"invoiceable": true,
"properties": {
"amount": "0"
}
}
]
}
],
"sample_events": [
{
"code": "gtm_email_sent",
"note": "POST /events { event: { transaction_id, external_subscription_id, code: 'gtm_email_sent' } } — one per send."
},
{
"code": "gtm_draft",
"note": "POST /events { event: { transaction_id, external_subscription_id, code: 'gtm_draft' } } — one per generated draft."
},
{
"code": "gtm_topup",
"note": "POST /events { event: { transaction_id: 'topup:<chargeId>', external_subscription_id, code: 'gtm_topup', properties: { amount_cents } } } — one per credited top-up (opt-in via RAGO_GTM_TOPUP_METERING=1)."
},
{
"code": "relay_llm_usage",
"note": "Sent by Relay, not vcglass: POST /events { event: { transaction_id: <relay event id>, external_subscription_id: <RELAY_RAGO_ROUTES_JSON subscription_id>, code: 'relay_llm_usage', properties: { charged_micros, total_tokens, model, ... } } }."
}
]
}