# Terminal Revenue Meter

AetherDesk can now turn terminal/API receipts into a repeatable revenue report. This is the first practical step toward paying for API usage
from the terminal itself: every governed run is counted, priced, reserved for API cost, and mapped to an offer tier.

## Product Shape

Sell AetherDesk as a governed terminal/API operator pack:

| Offer | Price | Included events | API reserve | Buyer promise |
|---|---:|---:|---:|---|
| Terminal Starter | $29/mo | 100 | $9 | Basic governed terminal/API usage for a solo operator. |
| Operator Pack | $99/mo | 500 | $30 | Daily governed browser, terminal, and API work with cost reserve. |
| Managed Automation Pilot | $750/mo | 2500 | $225 | Paid pilot with receipts, agent runs, and weekly proof reports. |

An "event" is a receipt-backed terminal, shell, browser, proof, or desktop/API action. The meter counts events locally first. Later, the same
numbers can be used to create Stripe usage records or invoices.

## Run From Terminal

```powershell
cd C:\Users\issda\AetherDesk
npm run revenue:terminal
npm run revenue:terminal -- --summary
npm run revenue:terminal -- --limit 250
npm run revenue:terminal -- --since 2026-06-01
```

Output schema:

```json
{
  "schema": "aetherdesk_terminal_revenue_v0",
  "metered_events": 42,
  "successful_events": 38,
  "gross_usage_value_cents": 1285,
  "api_cost_reserve_cents": 386,
  "net_estimated_cents": 899,
  "recommended_offer": {
    "id": "starter",
    "label": "Terminal Starter"
  }
}
```

## Run From HTTP

```powershell
Invoke-RestMethod "http://127.0.0.1:5717/api/revenue/terminal?limit=500"
```

## Run From MCP Connector

```json
{
  "jsonrpc": "2.0",
  "id": 8,
  "method": "tools/call",
  "params": {
    "name": "aetherdesk_revenue_meter",
    "arguments": {
      "limit": 500
    }
  }
}
```

## Why This Makes Money

The terminal already produces receipts. The missing business layer was a repeatable way to convert those receipts into:

- usage count
- successful work count
- billable value
- API-cost reserve
- estimated margin
- recommended offer tier

This lets AetherDesk support a simple sales loop:

1. Run a prospect workflow through AetherDesk.
2. Show the receipts and the revenue meter.
3. Quote the matching offer tier.
4. Use the report as the weekly proof artifact.
5. When Stripe is wired, bill from the same metered events.

## Safety Boundary

- This meter does not charge money.
- This meter does not call Stripe.
- This meter does not read stdout/stderr secrets.
- Receipts should continue to avoid raw API keys, tokens, and private credentials.
- Live billing should be added only after a separate Stripe checkout/usage-record gate is tested in dry-run mode.

## Next Stripe Step

Add a separate `billing/stripe_usage_export` script that reads `aetherdesk_terminal_revenue_v0`, maps events to a Stripe metered price, and
submits usage records only when all of these are true:

1. `STRIPE_SECRET_KEY` is present.
2. A customer id is explicitly supplied.
3. `--live` is supplied.
4. The dry-run report is saved first.

Until then, the revenue meter is the source of truth for pricing and API-cost planning.
