HelloPie has no subscription. The owner tops up credits in the Credits contract and each reply is paid from them, on chain. The contract is deployed on Base Sepolia (0xF0FC5a7a6801C6eBDBC23793a32B0fF5dd9e89dc), and replies have been charged on it (receipts on Contracts); this page describes how it works (apps/be/src/credits.ts).

How the price is worked out

  1. The engine measures each run: input, output and cached tokens, times the model’s live price per token from NEAR AI Cloud’s model list. That is the provider cost (costUsd).
  2. The backend adds the markup (CREDIT_MARKUP_PERCENT, 10 by default) and rounds up to a micro-dollar, at least one.
  3. The reply’s charge is recorded and counted against the owner’s credits at once (pending), so the next run already sees it.
  4. Settled in batches. One Credits.charge costs about 141k gas, which can be more than a short reply is billed. So the backend’s biller key sends one Credits.charge(owner, amount, ref) per account for many replies: when that account’s pending charges reach $0.05 (`SETTLE_MIN_CREDITS`) or the oldest is an hour old (`SETTLE_MAX_AGE_MINUTES`), at most $2 in one. The ref is fixed for that batch before the first try and the contract refuses a ref it has seen, so a retry can never charge twice. A failed settlement is retried every minute, up to five times. Each reply in the history then links to its batch’s transaction.
Example (worked out, not a live receipt): a reply that used 6,768 input and 44 output tokens at a provider cost of $0.00056344 is charged **$0.00062** with the 10% markup. Every charge the backend sends carries the ERC-8021 attribution code hellopie. A live charge on the current setup has not been run yet.

Limits that protect the owner

Before a run, the backend checks on chain that the owner’s balance, minus charges not sent yet, covers at least $0.002 (MIN_RUN_CREDITS) and that the daily cap has that much room; otherwise the API answers 402 insufficient_credits or 402 daily_cap_reached and nothing runs.

Topping up

  • From the owner’s wallet: the Credits screen asks the wallet to approve and deposit USDC, then sends the transaction hash to POST /v1/credits/topups. The backend records it only from the receipt: a successful transaction whose Deposited event credits the signed-in address.
  • From the Mind’s wallet: ask the Mind (skill credits, tool topup_credits). It waits for the owner’s approval, then sends approve plus Credits.deposit from the Mind’s governed account (both are whitelisted for its role), within the daily cap the backend enforces.
Only USDC is accepted for top-ups.

API

GET /v1/credits (balance, pending charges, daily cap and what is left today, read on chain), GET /v1/credits/history (top-ups and charges with their transactions), POST /v1/credits/topups. See the API reference. Guests run on the team’s credit and see no balance.