Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add tushaarmehtaa/tushar-skills --skill credit-meteringgit clone --depth 1 https://github.com/tushaarmehtaa/tushar-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/tushaarmehtaa/tushar-skills/credit-metering)<a href="https://agentmods.dev/skills/tushaarmehtaa/tushar-skills/credit-metering"><img src="https://agentmods.dev/badge/skills/tushaarmehtaa/tushar-skills/credit-metering/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/tushaarmehtaa/tushar-skills/credit-metering"><img src="https://agentmods.dev/badge/skills/tushaarmehtaa/tushar-skills/credit-metering.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00042 | $0.00759 |
| Opus 5.5 | $0.00017 | $0.00304 |
| Sonnet 5.5 | $0.00008 | $0.00152 |
| Haiku 4.5 | $0.00004 | $0.00076 |
Grade A, and why
credit-metering scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 36 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Credit metering
Build credits as a financial state machine. Preserve existing denominations, billing semantics, and provider integrations.
Workflow
- Inspect backend/runtime, database/ORM, auth and tenant keys, current balance/ledger fields, payment provider, usage paths, retries, queues, and frontend state.
- Infer existing costs, grants, and packs from code. Ask only for unresolved commercial policy: denomination, per-action or measured cost, free/recurring grants, expiration/rollover, refund/clawback behavior, and overspend/debt policy. Never default to a new payment provider when one exists.
- Read database schemas, then implement only the matching database variant. Do not treat PostgreSQL, MySQL, Prisma providers, and MongoDB as interchangeable. PlanetScale runs both Vitess (MySQL) and Postgres: detect the engine before choosing. Write migrations that can run twice.
- Use an append-only ledger with a unique idempotency key/external event ID. Update cached balance and ledger in one database transaction, or derive balance from the ledger when scale permits. Enforce positive input amounts and the chosen non-negative/debt rule in the database.
- Implement explicit operations:
grantfor signup, subscription, promotion, or admin credit;reservebefore costly/concurrent work;captureafter measured success;releaseon cancellation/failure;refundorreverselinked to the original transaction;expire/rolloverwhen credits have lifecycle rules.
- Authenticate and authorize from server context. Never accept balance, price, pack value, or user identity from the browser. Map a server-owned product/price ID to the credit amount.
- Read payment providers only for the detected provider, or for provider choice on a new build. Its facts carry a check date; re-check any older than 90 days before relying on it. On Lemon Squeezy, check its status and flag the Stripe Managed Payments migration path; do not start a new build on it by default. If the provider offers native credits (Dodo credit entitlements, Stripe credit grants), name one balance source of truth and keep gating usage in the app. Verify raw-body signatures, durably deduplicate events, and retry transient failures. Acknowledge before processing only after a durable queue/inbox write.
- Make promotions atomic. Use a redemption table with a unique
(promo_id, user_id)constraint when one redemption per user is intended; update global usage and grant credit in the same transaction. - Treat the UI balance as a projection. Reconcile after responses, account switches, multi-tab updates, refunds, and webhook grants. Optimistic display must not authorize work.
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago Changed d058976d659e
- 2mo ago First seen · 36 lines · 42 tokens per session scan A 26295bcbc73a
credit-metering is a skill published in the GitHub repository tushaarmehtaa/tushar-skills (12 stars, last pushed 2d ago), licensed MIT. It adds 42 tokens to every session and 759 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
credit-metering compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| credit-meteringtushaarmehtaa/tushar-skills | Skill | 12 | 2d ago | MIT | A | 42 | Claude Code, Codex |
| x402browser-use/browser-use | Skill | 120k | today | MIT | A | 175 | Claude Code |
| tushareHKUDS/Vibe-Trading | Skill | 38k | today | MIT | A | 79 | Claude Code, Codex |
| stripe-best-practicesstripe/ai | Skill | 2.0k | today | MIT | A | 161 | Claude Code, Codex |
| wechatpay-payment-integrationwechatpay-apiv3/wechatpay-skills | Skill | 372 | 5d ago | MIT | A | 330 | Claude Code, Codex |
| hyperliquid-websocketgalleonlabs/hypergrok-trading-desk | Skill | 350 | 3d ago | MIT | A | 89 | Claude Code |
| liter-llm-running-the-proxyxberg-io/liter-llm | Skill | 264 | today | MIT | A | 45 | Claude Code |